From b5f0ad25f8ecde5a959c60e22278dd4ec5042e35 Mon Sep 17 00:00:00 2001 From: geowarin Date: Thu, 3 Dec 2015 23:20:36 +0100 Subject: [PATCH 1/3] Add npm start stask --- examples/basic/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/basic/package.json b/examples/basic/package.json index e9fac6c..5d7a62e 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -16,5 +16,8 @@ "babel-preset-es2015": "^6.1.18", "babel-preset-react": "^6.1.18", "webpack": "^1.12.6" + }, + "scripts": { + "start": "webpack --watch" } } From af9f12582e288bd2dc1a21a3075d706919b441b3 Mon Sep 17 00:00:00 2001 From: geowarin Date: Thu, 3 Dec 2015 23:21:13 +0100 Subject: [PATCH 2/3] Migrate the basic example to the new API --- examples/basic/components/App.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/basic/components/App.js b/examples/basic/components/App.js index cc87e2e..dbfa5b8 100644 --- a/examples/basic/components/App.js +++ b/examples/basic/components/App.js @@ -1,9 +1,9 @@ const React = require('react'); const { Link } = require('react-router'); const { connect } = require('react-redux'); -const { updatePath } = require('redux-simple-router'); +const { pushPath } = require('redux-simple-router'); -function App({ updatePath, children }) { +function App({ pushPath, children }) { return (
@@ -16,7 +16,7 @@ function App({ updatePath, children }) { Bar
- +
{children}
@@ -25,5 +25,5 @@ function App({ updatePath, children }) { module.exports = connect( null, - { updatePath } + { pushPath } )(App); From fafe07a75b37e1938eeda3ed0142ed6961e41e06 Mon Sep 17 00:00:00 2001 From: geowarin Date: Thu, 3 Dec 2015 23:27:02 +0100 Subject: [PATCH 3/3] Add redux devTools --- examples/basic/app.js | 28 +++++++++++++++++++--------- examples/basic/package.json | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/examples/basic/app.js b/examples/basic/app.js index 0182eb8..a6213f8 100644 --- a/examples/basic/app.js +++ b/examples/basic/app.js @@ -1,10 +1,12 @@ const React = require('react'); const ReactDOM = require('react-dom'); -const { createStore, combineReducers } = require('redux'); +const { compose, createStore, combineReducers } = require('redux'); const { Provider } = require('react-redux'); const { Router, Route, IndexRoute } = require('react-router'); const createHistory = require('history/lib/createHashHistory'); const { syncReduxAndRouter, routeReducer } = require('redux-simple-router'); +import { devTools } from 'redux-devtools'; +const { DevTools, DebugPanel, LogMonitor } = require('redux-devtools/lib/react'); const reducers = require('./reducers'); const { App, Home, Foo, Bar } = require('./components'); @@ -12,20 +14,28 @@ const { App, Home, Foo, Bar } = require('./components'); const reducer = combineReducers(Object.assign({}, reducers, { routing: routeReducer })); -const store = createStore(reducer); +const finalCreateStore = compose( + devTools() +)(createStore); +const store = finalCreateStore(reducer); const history = createHistory(); syncReduxAndRouter(history, store); ReactDOM.render( - - - - - - - +
+ + + + + + + + + + +
, document.getElementById('mount') ); diff --git a/examples/basic/package.json b/examples/basic/package.json index 5d7a62e..4f74fb8 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -15,6 +15,7 @@ "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", "babel-preset-react": "^6.1.18", + "redux-devtools": "^2.1.5", "webpack": "^1.12.6" }, "scripts": {