-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
39 lines (30 loc) · 987 Bytes
/
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
36
37
38
import React from 'react'
import ReactDOM from 'react-dom'
import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import { createLogger } from 'redux-logger'
import { combineReducers } from 'redux'
import reducers from './reducers'
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
const logger = createLogger({
collapsed: true
});
let middleware = [ logger, thunk ];
const composeEnhancers =
typeof window === 'object' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
name: "Alexandria React"
}) : compose;
const enhancer = composeEnhancers(
applyMiddleware(...middleware),
// other store enhancers if any
);
export const store = createStore(combineReducers(reducers), enhancer);
ReactDOM.render(
<App store={store} />,
document.getElementById('root')
);
registerServiceWorker();