From 464afdb594a84a90fc9ce68eebd96a8ddb5e348b Mon Sep 17 00:00:00 2001 From: Michele Dibenedetto Date: Sun, 10 Sep 2017 16:46:17 +0100 Subject: [PATCH 1/2] Update redux-store.html I suggest to add support for REDUX dev tool extension used in Chrome, is very handy to have a panel which shows the timeline of changes in your state, to do that you need to use " window.devToolsExtension() or window.__REDUX_DEVTOOLS_EXTENSION__" and Redux.compose(). const store = Redux.createStore( reducer, Redux.compose( Redux.applyMiddleware(ReduxThunk.default), window.devToolsExtension && window.devToolsExtension() )); --- ep62-redux-async/redux-store.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ep62-redux-async/redux-store.html b/ep62-redux-async/redux-store.html index e3fd9e6..9887e65 100644 --- a/ep62-redux-async/redux-store.html +++ b/ep62-redux-async/redux-store.html @@ -37,8 +37,10 @@ } const store = Redux.createStore( reducer, - Redux.applyMiddleware(ReduxThunk.default) - ); + Redux.compose( + Redux.applyMiddleware(ReduxThunk.default), + window.devToolsExtension && window.devToolsExtension() + )); const ReduxBehavior = PolymerRedux(store); const AsyncActionsBehavior = { actions: { @@ -56,4 +58,4 @@ } } }; - \ No newline at end of file + From 3ee44308d5dd437cc236923fcec3c68fe5f998e0 Mon Sep 17 00:00:00 2001 From: Michele Dibenedetto Date: Mon, 11 Sep 2017 16:12:14 +0100 Subject: [PATCH 2/2] Update redux-store.html New update to deal in case REDUX DEV TOOL are not installed --- ep62-redux-async/redux-store.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ep62-redux-async/redux-store.html b/ep62-redux-async/redux-store.html index 9887e65..8689a37 100644 --- a/ep62-redux-async/redux-store.html +++ b/ep62-redux-async/redux-store.html @@ -34,13 +34,15 @@ username: action.username }); } - } - const store = Redux.createStore( + } + var store = Redux.createStore( reducer, Redux.compose( - Redux.applyMiddleware(ReduxThunk.default), - window.devToolsExtension && window.devToolsExtension() - )); + Redux.applyMiddleware(ReduxThunk.default), + window.devToolsExtension ? + window.devToolsExtension() : + v => v + )); const ReduxBehavior = PolymerRedux(store); const AsyncActionsBehavior = { actions: {