Messaging library for cross-browser extensions and Chrome apps
Sends redux actions (from popup, windows or inject pages) to be called in the background by their function name. Use with redux-persist and browser-redux-sync.
Usage
; ;; const isFromBackground = false; // should be true for the background script const finalCreateStore = createStoreconst extension = const rootReducer = const store = const persistor =
To send actions to be called in the background script:
In the container:
;;;; { return state: state ;} const mapDispatchToProps = ...someActions ...bgActions; mapStateToProps mapDispatchToPropssomeComponent;
In the component:
; { const ...someActions bg = thisprops; return <p> <button onClick= >Call an actionFunctionName in the background script</button> </p> ; } ;
See browser-redux for a boilerplate and more details.