Skip to content

Commit

Permalink
Use redux-devtools instead of redux-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
kuy committed May 13, 2016
1 parent 6811a1f commit dbe7f43
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"react-redux": "^4.4.5",
"redux": "^3.5.2",
"redux-actions": "^0.9.1",
"redux-devtools": "^3.3.1",
"redux-devtools-dock-monitor": "^1.1.1",
"redux-devtools-log-monitor": "^1.0.11",
"redux-logger": "^2.6.1",
"redux-saga": "^0.10.4",
"webpack": "^1.13.0",
Expand Down
12 changes: 12 additions & 0 deletions throttle/dev-tools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { createDevTools } from 'redux-devtools';
import LogMonitor from 'redux-devtools-log-monitor';
import DockMonitor from 'redux-devtools-dock-monitor';

const DevTools = createDevTools(
<DockMonitor toggleVisibilityKey='ctrl-h' changePositionKey='ctrl-q'>
<LogMonitor theme='tomorrow' />
</DockMonitor>
);

export default DevTools;
6 changes: 5 additions & 1 deletion throttle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import App from './app';
import DevTools from './dev-tools';
import configureStore from './store';

ReactDOM.render(
<Provider store={configureStore()}>
<App />
<div>
<App />
<DevTools />
</div>
</Provider>,
document.getElementById('container'));
9 changes: 5 additions & 4 deletions throttle/store.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { createStore, applyMiddleware } from 'redux';
import { createStore, applyMiddleware, compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
import logger from 'redux-logger';
import reducer from './reducers';
import rootSaga from './sagas';
import DevTools from './dev-tools';

export default function configureStore(initialState) {
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
reducer,
initialState,
applyMiddleware(
sagaMiddleware, logger()
compose(
applyMiddleware(sagaMiddleware),
DevTools.instrument()
)
);
sagaMiddleware.run(rootSaga);
Expand Down

0 comments on commit dbe7f43

Please sign in to comment.