sindresorhus / debounce

Delay function calls until a set time elapses after the last invocation
Other
798 stars 80 forks source link

Provide a way to cancel scheduled debounces #9

Closed jamestalmage closed 1 year ago

jamestalmage commented 8 years ago

I think the wrapped function should have a clear method attached to clear any scheduled debounce:

var debounced = debounce(fn, 300);

debounced();
debounced();
debounced.clear();
nathanbuchar commented 8 years ago

This was fixed in #10, but still hasn't been pushed to npm :( I need this feature as well, but I don't want the overhead of loadash or underscore.

nathanbuchar commented 7 years ago

For the record, I'm still waiting for this to be published to npm. :\

sindresorhus commented 1 year ago

This was added in 1.0.1.