Comparing version 0.2.5 to 0.2.6
@@ -56,2 +56,4 @@ # FluxibleContext | ||
Note: You may provide an app level `componentActionHandler` function when instantiating Fluxible. This allows you to catch errors (at a high level) spawning from components firing actions. | ||
This context interface should be passed in to your top level React component and then sent down to children as needed. These components will now have access to listen to store instances, execute actions, and access any methods added to the component context by plugins. | ||
@@ -58,0 +60,0 @@ |
@@ -11,2 +11,3 @@ # Fluxible | ||
* `options.component` (optional): Stores your top level React component for access using getComponent() | ||
* `options.componentActionHandler` (optional): App level component action handler. | ||
@@ -13,0 +14,0 @@ ## createContext(contextOptions) |
@@ -36,2 +36,3 @@ /** | ||
this._component = options.component || options.appComponent; | ||
this._componentActionHandler = options.componentActionHandler || this._defaultComponentActionHandler; | ||
this._plugins = []; | ||
@@ -73,2 +74,15 @@ | ||
/** | ||
* The default component action handler | ||
* @method defaultComponentActionHandler | ||
* @param {Error} [err] | ||
* @private | ||
*/ | ||
Fluxible.prototype._defaultComponentActionHandler = function defaultComponentActionHandler(err) { | ||
if (err) { | ||
debug('Action returned error', err); | ||
throw err; | ||
} | ||
}; | ||
/** | ||
* Creates a new dispatcher instance using the application's dispatchr class. Used by | ||
@@ -75,0 +89,0 @@ * FluxibleContext to create new dispatcher instance |
@@ -150,11 +150,6 @@ /** | ||
getStore: this._dispatcher.getStore.bind(this._dispatcher), | ||
// Disallows components from handling the callback for an action | ||
// Prevents components from directly handling the callback for an action | ||
executeAction: function componentExecuteAction(action, payload) { | ||
self.executeAction(action, payload, function executeActionCallback(err) { | ||
// @TODO provide a way to configure component action error handler | ||
if (err) { | ||
debug('Action returned error', err); | ||
throw err; | ||
} | ||
}); | ||
var actionHandler = self._app._componentActionHandler; | ||
self.executeAction(action, payload, actionHandler); | ||
} | ||
@@ -161,0 +156,0 @@ }; |
{ | ||
"name": "fluxible", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "A pluggable container for isomorphic flux applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
680
41228
19
1