@ztrehagem/synchronized-debounce
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ztrehagem/synchronized-debounce

synchronized-debounce makes easy to define debounced functions with async functions.

It's simple to use:

const synchronizedDebounce = require('@ztrehagem/synchronized-debounce')

const debounced = synchronizedDebounce(asyncFn, interval)

debounced() // just
debounced() // call
debounced() // anytime
debounced() // manytimes

Roughly the behavior is same to the debounce function. If the debounce tries calling asyncFn while awaiting previous execution of asyncFn, the next calling is deferred until exiting the previous one.

Package Sidebar

Install

npm i @ztrehagem/synchronized-debounce

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

2.55 kB

Total Files

5

Last publish

Collaborators

  • ztrehagem