Skip to content

Instantly share code, notes, and snippets.

@collin
Created January 9, 2018 04:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save collin/1d509a232e6877ea177425629a8a1bf5 to your computer and use it in GitHub Desktop.
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