1.0.0 • Published 5 years ago
@ngxs-extensions/decorators v1.0.0
ngxs-extensions
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...
}
1.0.0
5 years ago