Created
June 8, 2017 14:39
-
-
Save kellyrmilligan/f373bec91b222bf330f8058fb03c0031 to your computer and use it in GitHub Desktop.
integration example for redux and cra
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 ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import { updateServiceworker } from 'service-worker-redux' | |
import configureStore from 'store/configure-store' | |
import './index.css'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
const store = configureStore() | |
const onUpdate = () => { | |
store.dispatch(updateServiceworker()) | |
} | |
ReactDOM.render( | |
<Provider store={store}> | |
<App /> | |
</Provider>, | |
document.getElementById('root') | |
); | |
registerServiceWorker(onUpdate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment