Comparing version 0.2.11 to 0.2.12
@@ -164,20 +164,26 @@ /** | ||
handlerFns = {}; | ||
allHandlers.forEach(function actionHandlersEach(store) { | ||
if (handlerFns[store.name]) { | ||
// Don't call the default if the store has an explicit action handler | ||
return; | ||
} | ||
var storeInstance = self.getStore(store.name); | ||
if ('function' === typeof store.handler) { | ||
handlerFns[store.name] = store.handler.bind(storeInstance); | ||
} else { | ||
if (!storeInstance[store.handler]) { | ||
throw new Error(store.name + ' does not have a method called ' + store.handler); | ||
try { | ||
allHandlers.forEach(function actionHandlersEach(store) { | ||
if (handlerFns[store.name]) { | ||
// Don't call the default if the store has an explicit action handler | ||
return; | ||
} | ||
handlerFns[store.name] = storeInstance[store.handler].bind(storeInstance); | ||
} | ||
}); | ||
this.currentAction.execute(handlerFns); | ||
debug('finished ' + this.currentAction.name); | ||
this.currentAction = null; | ||
var storeInstance = self.getStore(store.name); | ||
if ('function' === typeof store.handler) { | ||
handlerFns[store.name] = store.handler.bind(storeInstance); | ||
} else { | ||
if (!storeInstance[store.handler]) { | ||
throw new Error(store.name + ' does not have a method called ' + store.handler); | ||
} | ||
handlerFns[store.name] = storeInstance[store.handler].bind(storeInstance); | ||
} | ||
}); | ||
this.currentAction.execute(handlerFns); | ||
} catch (e) { | ||
throw e; | ||
} finally { | ||
debug('finished ' + actionName); | ||
this.currentAction = null; | ||
} | ||
}; | ||
@@ -184,0 +190,0 @@ |
{ | ||
"name": "dispatchr", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "A Flux dispatcher for applications that run on the server and the client.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
464
71097