electronEnhancer([params])
March 15, 2017 ยท View on GitHub
Creates a store enhancer which registers a store to other electronEnhanced stores in other processes. If created in a Renderer process (Either a BrowserWindow or a webview), dispatches are forwarded to the electronEnhanced store in the main process. If an action is dispatched in the main process, the resulting change in state from that action is passed to all stores who's filter allows any of the changed state through.
Arguments
The arguments to this function are passed in as an object of argumentName: value.
Renderer Process
filter(Object|Function|true): Describes exactly what data in the Store the current process requires. See README.md for a proper description of the semantics. If any change occurs to a property that passes the filter, the new value will be updated in the current process. The default behavior allows any property.excludeUnfilteredState(Boolean): Whether to have any properties not passing thefilterto beundefined, rather than being the default values described by thereducer. This improves bug prevention at the cost of performance, since if a developer references a property in the store, they likely want that property to always be up to date. Default isfalse.
Either Process
preDispatchCallback(Function): A function to be executed prior to any dispatch.postDispatchCallback(Function): A function to be executed after any dispatch is made.dispatchProxy(Function): Allows actions from other processes to pass through other store enhancers such asredux-sagaby exposing the final dispatch function of the store to theelectronEnhancer. This would look likedispatchProxy: a => store.dispatch(a), wherestoreis the result ofcreateStore.actionFilter(Function): Allows filtering whether an action should be forwarded to other processes or not