Socket
Book a DemoInstallSign in
Socket

@ngxs-labs/state-diff-logger

Package Overview
Dependencies
Maintainers
8
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngxs-labs/state-diff-logger

This plugin enhances NGXS default logging, adding the state changes after each action execution. This way is much easier to debug what changes your action has done to the store.

latest
Source
npmnpm
Version
0.0.10
Version published
Maintainers
8
Created
Source

NGXS State Diff Logger Plugin

This plugin enhances NGXS default logging, adding the state changes after each action execution. This way is much easier to debug what changes your action has done to the store.

debug

Getting Started

In order to install the plugin you need to add the following packages

npm install --save-dev @ngxs-labs/state-diff-logger jsondiffpatch

yarn add -D @ngxs-labs/state-diff-logger jsondiffpatch

Next you need to include the plugin in you app.module.ts

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    NgxsModule.forRoot([TestState]),
    NgxsLoggerPluginModule.forRoot({
      disabled: environment.production,
    }),
    NgxsStateDiffLoggerModule,
    RouterModule.forRoot([], { initialNavigation: 'enabled' }),
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

That's it!

Now, each action will include changes to the store in the console.

FAQs

Package last updated on 21 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts