1
- import { createDevTools } from 'redux-devtools' ;
2
- import LogMonitor from 'redux-devtools-log-monitor' ;
3
- import DockMonitor from 'redux-devtools-dock-monitor' ;
1
+ import { createDevTools } from 'redux-devtools'
2
+ import LogMonitor from 'redux-devtools-log-monitor'
3
+ import DockMonitor from 'redux-devtools-dock-monitor'
4
4
5
- const React = require ( 'react' ) ;
6
- const ReactDOM = require ( 'react-dom' ) ;
7
- const { applyMiddleware, compose, createStore, combineReducers } = require ( 'redux' ) ;
8
- const { Provider } = require ( 'react-redux' ) ;
9
- const { Router, Route, IndexRoute } = require ( 'react-router' ) ;
10
- const createHistory = require ( 'history/lib/createHashHistory' ) ;
11
- const { syncHistory, routeReducer } = require ( 'redux-simple-router' ) ;
5
+ import React from 'react'
6
+ import ReactDOM from 'react-dom'
7
+ import { applyMiddleware , compose , createStore , combineReducers } from 'redux'
8
+ import { Provider } from 'react-redux'
9
+ import { Router , Route , IndexRoute } from 'react-router'
10
+ import createHistory from 'history/lib/createHashHistory'
11
+ import { syncHistory , routeReducer } from 'redux-simple-router'
12
12
13
- const reducers = require ( './reducers' ) ;
14
- const { App, Home, Foo, Bar } = require ( './components' ) ;
13
+ import * as reducers from './reducers'
14
+ import { App , Home , Foo , Bar } from './components'
15
15
16
- const history = createHistory ( ) ;
17
- const middleware = syncHistory ( history ) ;
18
- const reducer = combineReducers ( Object . assign ( { } , reducers , {
16
+ const history = createHistory ( )
17
+ const middleware = syncHistory ( history )
18
+ const reducer = combineReducers ( {
19
+ ...reducers ,
19
20
routing : routeReducer
20
- } ) ) ;
21
+ } )
21
22
22
23
const DevTools = createDevTools (
23
- < DockMonitor toggleVisibilityKey = ' ctrl-h'
24
- changePositionKey = ' ctrl-q' >
25
- < LogMonitor theme = ' tomorrow' />
24
+ < DockMonitor toggleVisibilityKey = " ctrl-h"
25
+ changePositionKey = " ctrl-q" >
26
+ < LogMonitor theme = " tomorrow" />
26
27
</ DockMonitor >
27
- ) ;
28
+ )
28
29
29
30
const finalCreateStore = compose (
30
31
applyMiddleware ( middleware ) ,
31
32
DevTools . instrument ( )
32
- ) ( createStore ) ;
33
- const store = finalCreateStore ( reducer ) ;
34
- middleware . listenForReplays ( store ) ;
33
+ ) ( createStore )
34
+ const store = finalCreateStore ( reducer )
35
+ middleware . listenForReplays ( store )
35
36
36
37
ReactDOM . render (
37
38
< Provider store = { store } >
@@ -47,4 +48,4 @@ ReactDOM.render(
47
48
</ div >
48
49
</ Provider > ,
49
50
document . getElementById ( 'mount' )
50
- ) ;
51
+ )
0 commit comments