Created
June 15, 2013 00:53
Revisions
-
cmwelsh created this gist
Jun 15, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ this.listenTo(this.model, 'change', this._onModelChange); initialize: function() { // Only save every second at most this._save = _.debounce(this._save, 1000); }, _onModelChange: function() { this._updateTotals(); this._save(); }, _save: _.throttle(function() { this.model.save() }, 1000),