with-cooldown
Stops calls to the supplied method happening for a cooldown period.
The initial call will go through, and for the timeout given all further calls will be immediately returned.
Multiple calls are not replayed after the cooldown.
This module works both with and without decorators, however decorators are the primary tested use-case.
Example
function syntax
; const foo = ; ; // => Only call me once; // immediate return
decorator syntax
@ { console; } const foo = ; foo; // => Only call me oncefoo; // immediate return
Contributing
Contributions are welcome.
Pull requests will not be merged without related unit tests.