On this page
useDebouncedRefHistory
Category | State |
---|---|
Export Size | 1.7 kB |
Last Changed | 2 weeks ago |
Related | useRefHistory useThrottledRefHistory |
Shorthand for useRefHistory
with debounced filter.
Usage
This function takes a snapshot of your counter after 1000ms when the value of it starts to change.
import { ref } from 'vue'
import { useDebouncedRefHistory } from '@vueuse/core'
const counter = ref(0)
const { history, undo, redo } = useDebouncedRefHistory(counter, { deep: true, debounce: 1000 })
Type Declarations
/**
* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.
*
* @see https://vueuse.org/useDebouncedRefHistory
* @param source
* @param options
*/
export declare function useDebouncedRefHistory<Raw, Serialized = Raw>(
source: Ref<Raw>,
options?: Omit<UseRefHistoryOptions<Raw, Serialized>, "eventFilter"> & {
debounce?: MaybeRefOrGetter<number>
}
): UseRefHistoryReturn<Raw, Serialized>
Source
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/useDebouncedRefHistory/