Created
May 29, 2019 12:49
-
-
Save daverivera/487cd90f1d358db49ffc94339cd54a78 to your computer and use it in GitHub Desktop.
redux-crosstab_webworker_index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { render } from 'react-dom' | |
-import { createStore } from 'redux' | |
+import { createStore, applyMiddleware } from 'redux' | |
import { Provider } from 'react-redux' | |
import App from './components/App' | |
import reducer from './reducers' | |
import 'todomvc-app-css/index.css' | |
+import { createStateSyncMiddleware, initStateWithPrevTab } from 'redux-state-sync' | |
+const config = {} | |
+const middlewares = [ | |
+ createStateSyncMiddleware(config), | |
+] | |
-const store = createStore(reducer) | |
+const store = createStore(reducer, {}, applyMiddleware(...middlewares)) | |
+initStateWithPrevTab(store) | |
render( | |
<Provider store={store}> | |
<App /> | |
</Provider>, | |
document.getElementById('root') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment