npm.io
1.0.0 • Published 7 years ago

@ngxs-extensions/decorators

Licence
MIT
Version
1.0.0
Deps
1
Size
80 kB
Vulns
0
Weekly
0

ngxs-extensions

Build Status NPM License

Extends @ngxs/store with decorators and maybe some time with other things...

Install

To install @ngxs-extensions/decorators run the following command:

npm install @ngxs-extensions/decorators

Usage

Import the module into your root application module:

import { NgModule } from '@angular/core';
import { NgxsModule } from '@ngxs/store';
import { NgxsExtensionsDecoratorsModule } from '@ngxs-extensions/decorators';

@NgModule({
  imports: [
    NgxsModule.forRoot(states),
    NgxsExtensionsDecoratorsModule.forRoot()
  ]
})
export class AppModule {}

@ResetStateToDefault

@ResetStateToDefault resets a state to default on method call. Can be used to reset a detail state on destroying of a detail view.

@ResetStateToDefault(DetailState)
ngOnDestroy() {
  // cleanup other things...
}