Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useDebouncedRefHistory.md
1---2category: State3related:4- useRefHistory5- useThrottledRefHistory6---78# useDebouncedRefHistory910Shorthand for `useRefHistory` with debounced filter.1112## Usage1314This function takes a snapshot of your counter after 1000ms when the value of it starts to change.1516```ts17import { useDebouncedRefHistory } from '@vueuse/core'18import { shallowRef } from 'vue'1920const counter = shallowRef(0)21const { history, undo, redo } = useDebouncedRefHistory(counter, { deep: true, debounce: 1000 })22```2324## Type Declarations2526```ts27/**28* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.29*30* @see https://vueuse.org/useDebouncedRefHistory31* @param source32* @param options33*/34export declare function useDebouncedRefHistory<Raw, Serialized = Raw>(35source: Ref<Raw>,36options?: Omit<UseRefHistoryOptions<Raw, Serialized>, "eventFilter"> & {37debounce?: MaybeRefOrGetter<number>38},39): UseRefHistoryReturn<Raw, Serialized>40```41