You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a lazy loaded module that imports EffectsModule.forFeature(...) and is accessible from multiple routes within the application. In other words loadChildren is defined for this module multiple times in the app-routing.module.ts file:
/a/b/feature
/c/d/feature
When configured like this ngrxOnInitEffects is triggered multiple times when visiting each route. I would have expected it to only execute one time.
If this is intended what is the suggested approach to ensuring that init code would only run one time?
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
angular @ 8.1.1
ngrx @ 8.1.0
The text was updated successfully, but these errors were encountered:
Closes#2106
BREAKING CHANGE:
BEFORE:
When the effect class was registered, the init action would be dispatched.
If the effect was provided in multiple lazy loaded modules, the init action would be dispatched for every module.
AFTER:
The init action is only dispatched once
The init action is now dispatched based on the identifier of the effect (via ngrxOnIdentifyEffects)
Expected behavior:
I have a lazy loaded module that imports EffectsModule.forFeature(...) and is accessible from multiple routes within the application. In other words loadChildren is defined for this module multiple times in the app-routing.module.ts file:
/a/b/feature
/c/d/feature
When configured like this ngrxOnInitEffects is triggered multiple times when visiting each route. I would have expected it to only execute one time.
If this is intended what is the suggested approach to ensuring that init code would only run one time?
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
angular @ 8.1.1
ngrx @ 8.1.0
The text was updated successfully, but these errors were encountered: