The command ng generate feature does create an effects class with the following effect (example):
@Effect()
loadBooks$ = this.actions$.pipe(ofType(BookActionTypes.LoadBooks));
(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
- Comment out the
@Effect() decorator by default
- don't provide a default effect after creation
- set
{ 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 command
ng generate featuredoes 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
LoadBooksaction 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