-
-
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
Schematics: Default effect leads to an endless loop #1573
Comments
We recently merged PR #1530 which resolves this issue 😅 . |
#1530 was released with |
The docs aren't reflecting these changes, would it be OK to open up a new issue to add the |
Thanks for the quick reply! However, I'm not sure #1530 actually fixes this. With
Version is 7.2.0 installed today 😇 What do you think about completely removing the sample effect if the |
It's easier to delete the code than to write it from scratch. I think we should at least add a note in the docs that the generated effect must be updated to return a new action. I don't usually dispatch the action until the effects are wired up but I can see how it causes an issue. |
You're right @fmalcher. We discussed the possible solutions in the issues thread, #1524 (comment). With @fmalcher's proposed solutions in mind, should we re-open this issue or leave this as is. If we re-open the issue do we still agree that commenting out the effect is the best solution? |
I want to put developers on the path of continuing with minor modifications. I'd recommend we do something similar to the |
Ah I see! Haven't seen this before -- this would have made THIS whole issue obsolete 🙈 sorry
Sounds good to me! I could live with both ways: (1) concatMap to EMPTY
(2) comment out
As I find (1) a sensible solution, should I submit a PR for this? |
Slightly related:
while
Am I right assuming that this is not intended and should be changed as well? 😅 |
I would also prefer option one 😄 The reason why |
It should still be typed when generating a feature because we have an actions union. |
The command
ng generate feature
does create an effects class with the following effect (example):(see https://github.com/ngrx/platform/blob/master/modules/schematics/src/effect/files/__name%40dasherize%40if-flat__/__name%40dasherize__.effects.ts#L24)
If left untouched, this will lead to a loop of death as soon as the first
LoadBooks
action is being dispatched.Possible solutions
@Effect()
decorator by default{ dispatch: false }
I don't like any of them – but I ran into that the infinite loop problem multiple times now 😆
Will prepare a PR if there is consensus about how we can solve this.
I would be willing to submit a PR to fix this issue
[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered: