simple-redux-logger
v1.1.2
Published
Logs actions and state to the console on both server and desktop.
Downloads
1
Readme
SIMPLE REDUX LOGGER
Logs actions and state to the console on both server and desktop.
How to use?
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducers';
export default function (initialState = {}) {
const middlewares = [thunk];
if (process.env.NODE_ENV === 'development') {
const logger = require('simple-redux-logger'); // eslint-disable-line global-require
middlewares.push(logger());
}
return createStore(rootReducer, initialState,
applyMiddleware(...middlewares));
}
Options
doStringify
- show entire state on server. Default is true .If you would like to shrink the output set to false.doLogClient
- in case of using redux-devtools-extension
, default false.
Usage with options:
middlewares.push(logger({ doStringify: false }));
License
MIT