Skip to content

Commit 782d6a0

Browse files
authored
docs: Update useDebouncedRef usage
Fixes issue with `useDebouncedRef` function so it can be readily imported to a project.
1 parent 9ce45f2 commit 782d6a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/reactivity-advanced.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ Creates a customized ref with explicit control over its dependency tracking and
9494
Creating a debounced ref that only updates the value after a certain timeout after the latest set call:
9595

9696
```js
97-
function useDebouncedRef(value, delay = 200) {
97+
import { customRef } from 'vue'
98+
99+
export function useDebouncedRef(value, delay = 200) {
98100
let timeout
99101
return customRef((track, trigger) => {
100102
return {

0 commit comments

Comments
 (0)