Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 872 Bytes

README.md

File metadata and controls

34 lines (28 loc) · 872 Bytes

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;
  },
})