Created
October 1, 2020 00:42
-
-
Save amadeus/c1ceff0d3d66cf8a40f8e2700aad1f2e to your computer and use it in GitHub Desktop.
This file contains 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 characters
if (this._interceptor == null || !this._interceptor(action)) { | |
mark(action.type); | |
this._currentDispatchActionType = action.type; | |
try { | |
const actionHandlers = | |
this._orderedActionHandlers[action.type] || this._computeOrderedActionHandlers(action.type); | |
for (let i = 0, l = actionHandlers.length; i < l; i++) { | |
const {actionHandler, storeDidChange} = actionHandlers[i]; | |
if (actionHandler(action) !== false) { | |
storeDidChange(action); | |
} | |
} | |
Store.emitChanges(); | |
// Possible fix for FF dirty dispatch exceptions | |
// Assumption is that FF is maybe executing a finally block after a setTimeout(0)??? | |
this._currentDispatchActionType = null; | |
} catch (e) { | |
console.warn('Dispatch Error', e); | |
} finally { | |
this._currentDispatchActionType = null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment