sindresorhus / debounce

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

Rewrite: use underscore.js implementation #2

Closed TooTallNate closed 10 years ago

TooTallNate commented 10 years ago

Thoughts? This version is a lot more robust. We'll need to tag as v1.0.0 after merge and publish on npm accordingly.

TooTallNate commented 10 years ago

@MatthewMueller I know that you are a fan of this module. Do you agree with these changes?

matthewmueller commented 10 years ago

ohh man, i love this module. umm, what's the added benefit?

matthewmueller commented 10 years ago

also, does the API change?

TooTallNate commented 10 years ago

It should be basically the same behavior/API. This version just has some extra niceties that you would expect, like this support and (caching) return values.

TooTallNate commented 10 years ago

I would like to to the same thing to throttleit component, but that one actually is a breaking API/behavior change so it's more controversial (comparatively I think this one is safe).

matthewmueller commented 10 years ago

okay cool i'm +1 then.

dominicbarnes commented 10 years ago

Nice +1 on this... just realized that the current implementation doesn't return the value returned by the debounced fn. :(

TooTallNate commented 10 years ago

@dominicbarnes Sweet, so v1.0.0 has been released then. Let me know if you run into any issues!

dominicbarnes commented 10 years ago

Awesome! I'll start using it right away actually. Thanks :)