theatre/packages/r3f/src/components/useRefreshSnapshot.ts

12 lines
306 B
TypeScript
Raw Normal View History

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()
}, [])
}