Kaynağa Gözat

Added Chrome Redux Dev tools support.

Tomi Cvetic 8 yıl önce
ebeveyn
işleme
e124b93424
1 değiştirilmiş dosya ile 6 ekleme ve 2 silme
  1. 6 2
      src/index.js

+ 6 - 2
src/index.js

@@ -1,7 +1,7 @@
 import React from 'react'
 import ReactDOM from 'react-dom'
 import { browserHistory, Router, Route, IndexRedirect } from 'react-router'
-import { createStore, combineReducers } from 'redux'
+import { createStore, combineReducers, compose } from 'redux'
 import { Provider } from 'react-redux'
 import { syncHistoryWithStore, routerReducer } from 'react-router-redux'
 
@@ -23,7 +23,11 @@ const defaultState = {
   projects: project.state
 }
 
-const store = createStore(rootReducer, defaultState)
+const enhancers = compose(
+    window.devToolsExtension ? window.devToolsExtension() : f => f
+)
+
+const store = createStore(rootReducer, defaultState, enhancers)
 const history = syncHistoryWithStore(browserHistory, store)
 
 /**