mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
15 lines
342 B
TypeScript
15 lines
342 B
TypeScript
import { useStore } from 'vuex'
|
|
import debounce from 'lodash/debounce'
|
|
import { State, ActionTypes } from '@/store'
|
|
|
|
export default () => {
|
|
const store = useStore<State>()
|
|
|
|
const addHistorySnapshot = debounce(function() {
|
|
store.dispatch(ActionTypes.ADD_SNAPSHOT)
|
|
}, 300, { trailing: true })
|
|
|
|
return {
|
|
addHistorySnapshot,
|
|
}
|
|
} |