rendererStore.js 563 B

12345678910111213141516171819202122
  1. // Create the client-side Redux store.
  2. // This store's only purpose is to sync with the main store.
  3. const { createStore, applyMiddleware } = require('redux');
  4. const {
  5. forwardToMain,
  6. getInitialStateRenderer,
  7. replayActionRenderer
  8. } = require('electron-redux');
  9. const thunk = require('redux-thunk').default;
  10. const initialState = getInitialStateRenderer();
  11. import rootReducer from '../core/rootReducer';
  12. const store = createStore(
  13. rootReducer,
  14. initialState,
  15. applyMiddleware(forwardToMain, thunk)
  16. );
  17. replayActionRenderer(store);
  18. module.exports = store;