Debouncing backbone.js events
Sometimes you might want to debounce (prevent from firing more than once every X milliseconds) the events that you've hooked up to your Backbone views.
events:
'click #BtnAddIncome': 'addIncome'
addIncome: _.debounce(
-> @_addTransaction('Income', Data.UncategorizedIncome)
2000
)
Written by Michael Warkentin
Related protips
1 Response
thats interesting, I like that technique. I've been hacking it by adding a flag and manually unflaging after with timeouts.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Coffeescript
Authors
iam4x
94.17K
ericdfields
63.02K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#