-
Notifications
You must be signed in to change notification settings - Fork 54
/
index.js
35 lines (31 loc) · 1.12 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import 'babel-polyfill'
require('es6-promise').polyfill()
import React from 'react'
import { render } from 'react-dom'
import { Router, browserHistory, Redirect } from 'react-router'
import useScroll from 'scroll-behavior/lib/useStandardScroll'
import { Provider } from 'react-redux'
import { createStore, applyMiddleware, combineReducers } from 'redux'
import thunk from 'redux-thunk'
import { syncHistoryWithStore, routerReducer } from 'react-router-redux'
import createLogger from 'redux-logger'
import routes from './src/routes'
import * as reducers from './src/reducers'
import * as actions from './src/actions'
import styles from './src/styles/'
const logger = createLogger({
predicate: (getState, action) => action.type !== 'FETCHING'
})
const reducer = combineReducers({
...reducers,
routing: routerReducer
})
const store = createStore(reducer, applyMiddleware(thunk, logger))
const scrollHistory = useScroll(() => browserHistory)()
const history = syncHistoryWithStore(scrollHistory, store)
render(
<Provider store={store}>
<Router history={history} routes={routes} />
</Provider>,
document.getElementById('root')
)