npm.io
0.1.3 • Published 9 months ago

vue3-delay-watch

Licence
ISC
Version
0.1.3
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
1

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

  1. The watcher function or watched target (same as watch uses) (required)
  2. The watcher callback (required)
  3. The minimum delay in milliseconds between the update hooks (default is 1000)
  4. Sync callback without delay

Keywords