Search code examples
angularrxjsngrxngrx-storengrx-effects

NgRx effect is not initialized when navigating back to module


I have a lazy loaded module that holds a state with forFeature provider, and that module holds effect that injected specifically to the module.

when I navigate to another route(another lazy loaded module), and go back to the module with the state, the effect is not triggered again as I expect.

Effect:

enter image description here enter image description here

OptimizationTabModule: enter image description here


Solution

  • This is is working as intended. The OnInit is fired when the effect is registered (which is only once).