UNPKG

835 BJSXView Raw
1'use strict'
2
3import {h, render} from 'preact'
4import {Provider} from 'preact-redux'
5import {
6 applyMiddleware,
7 combineReducers,
8 compose,
9 createStore
10} from 'redux'
11import thunk from 'redux-thunk'
12import {enableBatching} from 'lib/redux'
13import createHistory from 'history/createBrowserHistory'
14import syncRouteWithStore from 'middleware/router'
15
16import * as reducers from 'reducers'
17
18import App from 'containers/App/App'
19
20const browserHistory = createHistory()
21const reducer = combineReducers(reducers)
22const storeComposer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
23const store = storeComposer(applyMiddleware(thunk))(createStore)(enableBatching(reducer))
24const history = syncRouteWithStore(browserHistory, store)
25
26render((
27 <Provider store={store}>
28 <App history={history} />
29 </Provider>
30), document.body)