12 lines
306 B
TypeScript
12 lines
306 B
TypeScript
|
import {useCallback} from 'react'
|
||
|
import {useEditorStore} from '../store'
|
||
|
|
||
|
/**
|
||
|
* Returns a function that can be called to refresh the snapshot in the snapshot editor.
|
||
|
*/
|
||
|
export default function useRefreshSnapshot() {
|
||
|
return useCallback(() => {
|
||
|
useEditorStore.getState().createSnapshot()
|
||
|
}, [])
|
||
|
}
|