@asayerio/redux
v1.0.0
Published
Redux middleware for Asayer
Downloads
3
Readme
Asayer Redux
A Redux middleware for Asayer. This middleware allowed you to see your application state during session replay.
Installation
npm i @asayerio/redux --save
Usage
Initialize the @asayerio/js
package and then put the middleware into your Redux chain
import { applyMiddleware, createStore } from 'redux';
import createMiddleware from '@asayerio/redux';
const store = createStore(
reducer,
applyMiddleware(createMiddleware()),
);
You can customize the middleware behaviour with options to sanitize your data.
createMiddleware({
actionFilter: action => action.type !== 'DRAW', // only actions which pass this test will be recorded
actionTransformer: action => action.type === 'LOGIN' ? { type: 'LOGIN' } : action,
stateTransformer: state => {
const { jwt, ..._state } = state;
return _state;
},
})