Necrotizing Pineapple Music

    @asayerio/tracker-ngrx

    5.7.0 • Public • Published

    Asayer Tracker NgRx plugin

    A NgRx meta-reducer for Asayer Tracker. This plugin allows you to see the application state during session replay.

    Installation

    npm i @asayerio/tracker-ngrx --save

    Usage

    Initialize the @asayerio/tracker package as usual and load the plugin into it. Then put the generated meta-reducer into your imports. See NgRx documentation for details.

    import { StoreModule } from '@ngrx/store';
    import { reducers } from './reducers';
    import Tracker from '@asayerio/tracker';
    import trackerNgRx from '@asayerio/tracker-ngrx';
    
    const tracker = new Tracker({
      projectID: PROJECT_ID,
    });
    
    const metaReducers = [tracker.plugin(trackerNgRx())];
    
    @NgModule({
      imports: [StoreModule.forRoot(reducers, { metaReducers })],
    })
    export class AppModule {}

    You can customize the middleware behaviour with options to sanitize your data.

    trackerNgRx({
      actionFilter: action => action.type !== 'DRAW', // only actions which pass this test will be recorded
      actionTransformer: action => action.type === 'LOGIN' ? null : action,
      actionType: action => action.type // action type for search, that's the default one
      stateTransformer: state => {
        const { jwt, ..._state } = state;
        return _state;
      },
    })

    Install

    npm i @asayerio/tracker-ngrx

    DownloadsWeekly Downloads

    39

    Version

    5.7.0

    License

    MIT

    Unpacked Size

    27.3 kB

    Total Files

    24

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar