Middleware that add redux state to the payload of Rollbar logs
Note: lib/
is in repo until we publish package on npm
npm install redux-rollbar-state-middleware --save
# or
yarn install redux-rollbar-state-middleware --save
import rollbarStateMiddleware from 'redux-rollbar-state-middleware'
const middleware = rollbarStateMiddleware(rollbar, options)
Name | Type | Default | Description |
---|---|---|---|
sanitizeState | function |
- | You can change the state before adding it to the Rollbar configuration |
import { createStore, applyMiddleware } from 'redux'
import rollbarStateMiddleware from 'redux-rollbar-state-middleware'
import Rollbar from 'rollbar' // server usage. for client use the instruction https://rollbar.com/docs/notifier/rollbar.js/#umd--browserify--requirejs--webpack
const rollbar = new Rollbar({ /* ... some config */ })
const middleware = [
rollbarStateMiddleware(rollbar)
];
export const store = createStore(
appReducers,
composeWithDevTools(
applyMiddleware(...middleware),
)
)
You can find more usecases in the tests.
MIT