Tiny async debouncer
npm install debounceify
const debounceify = require('debounceify')
const debounced = debounceify(async function () {
console.log('Running...')
await new Promise(resolve => setTimeout(1000, resolve))
})
const a = debounced() // triggers the about function
const b = debounced()
const c = debounced()
const d = debounced() // these last 3 wait for the first one to finish
// then trigger one more.
await a
await b
await c
await d
fn = debounceify(asyncFunction)Debounces the asyncFunction so that
asyncFunction will happenasyncFunction is running only one more will be triggered when it finishes.debounceify.runningThe active running job, null if none.
MIT
Overall
Maintained
Code review
npm
Latest release
Releases this year
59 followers · starred Jan 2021
Tiny async debouncer
npm install debounceify
const debounceify = require('debounceify')
const debounced = debounceify(async function () {
console.log('Running...')
await new Promise(resolve => setTimeout(1000, resolve))
})
const a = debounced() // triggers the about function
const b = debounced()
const c = debounced()
const d = debounced() // these last 3 wait for the first one to finish
// then trigger one more.
await a
await b
await c
await d
fn = debounceify(asyncFunction)Debounces the asyncFunction so that
asyncFunction will happenasyncFunction is running only one more will be triggered when it finishes.debounceify.runningThe active running job, null if none.
MIT
Overall
Maintained
Code review
npm
Latest release
Releases this year
59 followers · starred Jan 2021