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