Life-cycle
ngxsOnChanges
ngxsOnChangesexport interface ZooStateModel {
animals: string[];
}
@State<ZooStateModel>({
name: 'zoo',
defaults: {
animals: []
}
})
@Injectable()
export class ZooState implements NgxsOnChanges {
ngxsOnChanges(change: NgxsSimpleChange) {
console.log('prev state', change.previousValue);
console.log('next state', change.currentValue);
}
}ngxsOnInit
ngxsOnInitngxsAfterBootstrap
ngxsAfterBootstrapLifecycle sequence
Hook
Purpose and Timing
Feature Modules Order of Imports
APP_INITIALIZER Stage
Theoretical Introduction
APP_INITIALIZER and NGXS
Solution
Summary
Last updated

