vue3-delay-watch
v0.1.2
Published
vue 3 watcher that waits a minimum delay until the latest state gets passed to the watch hook
Downloads
60
Maintainers
Readme
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