-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attaching multiple effects in forRoot prevents any effects from running #269
Comments
related to #232 ? |
i found how to stop this behaviour: in my case it depends on services being injected in |
i've finally found the issue. basically if you require a service in the effect class that is already included in the component it will silently crash. to proof this i've created two copies of the same service and renamed the type in order to have a new copy of it and i required it in the effect class' constructor. (yeah, it required a lot of debugging) |
If this is an ngrx issue, can you provide a reproduction of this issue? Preferably in a plunker or a github repo. Here is a plunker template http://plnkr.co/edit/tpl:757r6L?p=preview |
i've found the REAL issue. it was a timing bug. basically in the effect class i was injecting a service that in the constructor was dispatching the very first action so the effect class was instantiated AFTER the very first action being dispatched. @brandonroberts what do you think about this? |
While it would certainly improve the developer experience, there currently isn't a way for us to do introspection of reducer functions and know what actions they handle. Glad you were able to track down the issue! |
@MikeRyanDev i got your point. i saw that every reducer is called on every actions and that is the |
I'm submitting a...
What is the current behavior?
if i add multiple effects in the effects module's forRoot, it stops from running every effects.
Expected behavior:
every registered effects works as expected.
Minimal reproduction of the problem with instructions:
EffectsModule.forRoot([Effect1]),
// WORKSEffectsModule.forRoot([Effect1, Effect2]),
// DOES NOT WORKif you specify more than one effect class, the effects' handlers are not called!
can be related to this line, maybe is the spread operator missing?
Version of affected browser(s),operating system(s), npm, node and ngrx:
latest
Other information:
single element array works, with two elements is not working.
The text was updated successfully, but these errors were encountered: