Lifecycle
After creating the state by calling its constructor, NGXS calls the lifecycle hook methods in the following sequence at specific moments:
Hook
Purpose and Timing
ngxsOnChanges()
Called before ngxsOnInit()
and whenever state changes.
ngxsOnInit()
Called once, after the first ngxsOnChanges()
and before the APP_INITIALIZER
token is resolved.
ngxsAfterBootstrap()
Called once, after the root view and all its children have been rendered.
ngxsDataDoCheck()
Called after ngxsAfterBootstrap()
and called every time a state is reinitialized after a state reset.
ngxsDataAfterReset()
Called every time after reset()
ngxsDataDoCheck
and ngxsDataAfterReset
ngxsDataDoCheck
and ngxsDataAfterReset
ngxsOnChanges
, ngxsOnInit
and ngxsAfterBootstrap
ngxsOnChanges
, ngxsOnInit
and ngxsAfterBootstrap
Last updated