Created
January 9, 2018 04:32
-
-
Save collin/1d509a232e6877ea177425629a8a1bf5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 as ReduxProvider } from 'react-redux'; | |
import AppContainer from './app-container'; | |
import createActionRegistry from './store/actions' | |
import createThunkRegistry from './store/thunks' | |
import history from './store/history' | |
import configureStore from './store/configure-store'; | |
export default function bootloader () { | |
const app = { | |
history, | |
Actions: createActionRegistry(), | |
Thunks: createThunkRegistry(), | |
root: document.querySelector('#root'), | |
getStore () { | |
return configureStore({ | |
rootReducer: require(`~/reducers`) | |
}) | |
}, | |
renderApp () { | |
const App = require('~/components/app').default | |
ReactDOM.render( | |
<ReduxProvider store={this.getStore()}> | |
<AppContainer app={App}/> | |
</ReduxProvider>, | |
this.root | |
) | |
}, | |
} | |
return app | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment