Debounce π
Last updated
Was this helpful?
Last updated
Was this helpful?
Debounce is a common function that waits a set amount of time before invoking a callback.
yarn add @common-utilities/debounce -D
let result = 1
const add1 = (val) => {
result = val + 1
}
debounce(add1, 1000)(1) // returns 2, after 1 second
No cruft. No bloat. No dependencies.
Simple, typed, functional, documented, and tested javascript utility functions.
View other common utilities on Github.