You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// your answers
<script setup>
import { watch, customRef } from"vue"/** * Implement the function*/functionuseDebouncedRef(value, delay=200) {let timeout;returncustomRef((track, trigger) => {return {get() {track();return value; },set(newValue) {clearTimeout(timeout); timeout =setTimeout(() => { value = newValue;trigger(); }, delay); } }});}consttext=useDebouncedRef("hello")/** * Make sure the callback only gets triggered once when entered multiple times in a certain timeout*/watch(text, (value) => {console.log(value)})
</script>
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: