Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use _.uniqueId() for loadCounter

  • Loading branch information...
commit 0468fa9d6a281f91dff45552a603993d68fdac95 1 parent c447801
@Candid Candid authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/loading.js
View
6 src/loading.js
@@ -7,10 +7,8 @@ Thorax.setRootObject = function(obj) {
rootObject = obj;
};
-var _loadCounter = 0;
-
Thorax.loadHandler = function(start, end, context) {
- var loadCounter = _loadCounter++;
+ var loadCounter = _.uniqueId();
return function(message, background, object) {
var self = context || this;
self._loadInfo = self._loadInfo || [];
@@ -79,7 +77,7 @@ Thorax.loadHandler = function(start, end, context) {
// If stopping make sure we don't run a start
clearTimeout(loadInfo.timeout);
- loadInfo = self._loadInfo[loadCounter] =undefined;
+ loadInfo = self._loadInfo[loadCounter] = undefined;
}
} catch (e) {
Thorax.onException('loadEnd', e);
Please sign in to comment.
Something went wrong with that request. Please try again.