Skip to content

asayerio/redux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published