Guest User

Untitled

a guest
Jan 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3.  
  4. import { Provider as ReduxProvider } from 'react-redux';
  5.  
  6. import AppContainer from './app-container';
  7. import createActionRegistry from './store/actions'
  8. import createThunkRegistry from './store/thunks'
  9. import history from './store/history'
  10.  
  11. import configureStore from './store/configure-store';
  12.  
  13. export default function bootloader () {
  14. const app = {
  15. history,
  16. Actions: createActionRegistry(),
  17. Thunks: createThunkRegistry(),
  18. root: document.querySelector('#root'),
  19. getStore () {
  20. return configureStore({
  21. rootReducer: require(`~/reducers`)
  22. })
  23. },
  24. renderApp () {
  25. const App = require('~/components/app').default
  26. ReactDOM.render(
  27. <ReduxProvider store={this.getStore()}>
  28. <AppContainer app={App}/>
  29. </ReduxProvider>,
  30. this.root
  31. )
  32. },
  33. }
  34.  
  35. return app
  36. }
Add Comment
Please, Sign In to add comment