Comparing version 1.0.5 to 1.1.0
# Change Log | ||
## 1.1.0 | ||
### Features | ||
* [#418] Added `plugExecuteAction` hook to plugin API to allow tracking of execute calls | ||
## 1.0.5 | ||
@@ -4,0 +10,0 @@ |
@@ -30,2 +30,5 @@ /** | ||
// ExecuteAction Plugins | ||
this._executeActionPlugins = []; | ||
// Set up contexts | ||
@@ -37,4 +40,2 @@ this._actionContext = null; | ||
var warnedOnce = false; | ||
/** | ||
@@ -82,2 +83,6 @@ * Getter for the app's component. Pass through to the Fluxible instance. | ||
this._plugins.push(plugin); | ||
var executeActionPlugin = plugin.plugExecuteAction; | ||
if (executeActionPlugin) { | ||
this._executeActionPlugins.push(executeActionPlugin); | ||
} | ||
}; | ||
@@ -120,2 +125,15 @@ | ||
context._executeActionPlugins.forEach(function pluginsEach(executeActionPlugin) { | ||
var pluggedExecuteAction = executeActionPlugin({ | ||
actionContext: actionContext, | ||
action: action, | ||
payload: payload, | ||
done: done | ||
}); | ||
actionContext = pluggedExecuteAction.actionContext; | ||
action = pluggedExecuteAction.action; | ||
payload = pluggedExecuteAction.payload; | ||
done = pluggedExecuteAction.done; | ||
}); | ||
if (debug.enabled) { | ||
@@ -160,3 +178,2 @@ debug('Executing action ' + actionContext.stack.join('.') + ' with payload', payload); | ||
FluxContext.prototype._createSubActionContext = function createSubActionContext(parentActionContext, action) { | ||
var displayName = action.displayName || action.name; | ||
/* | ||
@@ -171,3 +188,5 @@ * We store the action's stack array on the `stack` property | ||
*/ | ||
var displayName = action.displayName || action.name; | ||
var newActionContext = Object.assign({}, this.getActionContext(), { | ||
displayName: displayName, | ||
stack: (parentActionContext.stack || []).concat([displayName]), | ||
@@ -174,0 +193,0 @@ rootId: (parentActionContext.rootId) || generateUUID() |
{ | ||
"name": "fluxible", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "A pluggable container for isomorphic flux applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
44890
747