Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _.debounce to Underscore #66

Closed
fschaefer opened this issue Nov 30, 2010 · 3 comments
Closed

Add _.debounce to Underscore #66

fschaefer opened this issue Nov 30, 2010 · 3 comments

Comments

@fschaefer
Copy link

I've extended Underscore by mixing in a debounce function from: http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
and used it in conjunction with Backbone.sync to limit calls that may be happening several times because of async actions.

It would be nice to have this function in Underscore. Maybe also the throttling stuff:
https://github.com/cowboy/jquery-throttle-debounce/blob/master/jquery.ba-throttle-debounce.js

@jashkenas
Copy link
Owner

Good idea. I've added a _.throttle, and _.debounce, here:

9e3e067

... let me know what you think.

@cehoffman
Copy link

Awesome, can get rid of some code with this.

@fschaefer
Copy link
Author

Works as expected. Thank you for inclusion!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants