mole-redux
mole-redux is a tiny helper library that works as a middleware for redux, allowing easy state-action molejs. Underneath, it uses the report() method from mole-reporter one of the three independent packages that form the whole molejs service stack.
All the reported logs follow the mole log specification.
Requirements
Install
npm install --save mole-redux
Configure with redux
When loading your store use applyMiddleware
and createStoreWithMiddleware
as described by the redux docs.
; /* ... */ let createStoreWithMiddleware = ;let appReducers = ;let store = ;
Error logging
In order to actually do the logging you still need to integrate mole-reporter to implement the report and config methods.
The first thing, is to surround your application's entry point in a try-catch block. In react, this would look something like the following, though YMMV.
;;/* import Component */ Mole; try React; catch error Mole;