You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No innovations here, just a logger middleware for redux that will write all redux actions and state changes to the node console. Entirely based on redux-logger
Usage
redux-node-logger must be called as a function before being utilized as middleware. This allows passing in options to overwrite all colors and arrow icons, as well as a predicate that functions like that in redux-logger. Here's what a simple configureStore function might look like
functionconfigureStore(){//other conditions like client etc}elseif(SERVER&&DEVELOPMENT){constcreateNodeLogger=require('redux-node-logger');finalCreateStore=compose(applyMiddleware(promiseMiddleware,createNodeLogger({/* an options object */})),createStore);}returnfinalCreateStore(rootReducer);}
Options Object
The option object has overridable defaults that look like this:
###immutable
works fine because it converts to POJO on JSON.stringify
###Source
uses renderkid to output color and formatting. Doesn't seem to support JSON.stringify(obj, null, 4) for instance. Anyhow, not much to it really. Feel free to look in on createNodeLogger.js and build something more to your needs