Created
January 20, 2012 16:08
Revisions
-
jmreidy created this gist
Jan 20, 2012 .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,11 @@ activeRequests = [] Backbone._sync = Backbone.sync Backbone.sync = (method, model, options) -> asyncToken = Backbone._sync.apply(this,arguments) asyncToken.then () -> activeRequests = _.without activeRequests, asyncToken if activeRequests.length == 0 then console.log "LOADING COMPLETE" if activeRequests.length == 0 console.log "START LOADING" activeRequests.push asyncToken