Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- }
Add Comment
Please, Sign In to add comment