Vue 3 Delay watch
Usage
import delayWatch from 'vue3-delay-watch'
const foo = ref('bar');
delayWatch(foo, (newVal, oldVal) => {
console.log('foo did changed!', newVal);
}, 1000);
Arguments
- The watcher function or watched target (same as
watch
uses) (required) - The watcher callback (required)
- The minimum delay in milliseconds between the update hooks (default is
1000
) - Sync callback without delay