From 43c72f445c7906ab707493b3e857acf83d5bcd1f Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Thu, 14 Dec 2017 16:36:23 +0100 Subject: Add redux-logger --- package.json | 1 + src/client/react/index.jsx | 9 +++++---- yarn.lock | 10 ++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7a48b7c..d828a9e 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "react-redux": "^5.0.6", "react-router-dom": "^4.2.2", "redux": "^3.7.2", + "redux-logger": "^3.0.6", "request": "^2.74.0", "sass-loader": "^6.0.6", "smoothscroll-polyfill": "^0.3.4", diff --git a/src/client/react/index.jsx b/src/client/react/index.jsx index 8c92bb1..f0e4e23 100644 --- a/src/client/react/index.jsx +++ b/src/client/react/index.jsx @@ -2,16 +2,17 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { BrowserRouter as Router, Route } from 'react-router-dom'; -import { createStore } from 'redux'; +import { createStore, applyMiddleware, compose } from 'redux'; +import logger from 'redux-logger'; import reducer from './reducers'; import LandingPage from './LandingPage'; -/* eslint-disable no-underscore-dangle */ +// eslint-disable-next-line no-underscore-dangle +const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const store = createStore( reducer, - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), + composeEnhancers(applyMiddleware(logger)), ); -/* eslint-enable */ ReactDOM.render( diff --git a/yarn.lock b/yarn.lock index 1068dfe..f9f4907 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1945,6 +1945,10 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +deep-diff@^0.3.5: + version "0.3.8" + resolved "https://registry.yarnpkg.com/deep-diff/-/deep-diff-0.3.8.tgz#c01de63efb0eec9798801d40c7e0dae25b582c84" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -5936,6 +5940,12 @@ reduce-function-call@^1.0.1: dependencies: balanced-match "^0.4.2" +redux-logger@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/redux-logger/-/redux-logger-3.0.6.tgz#f7555966f3098f3c88604c449cf0baf5778274bf" + dependencies: + deep-diff "^0.3.5" + redux@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/redux/-/redux-3.7.2.tgz#06b73123215901d25d065be342eb026bc1c8537b" -- cgit v1.1