Skip to content
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

fix(effects): dispatch init action once #2164

Merged
merged 3 commits into from
Jan 16, 2020
Merged

Conversation

timdeschryver
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #2106

What is the new behavior?

See the breaking change section below

Does this PR introduce a breaking change?

[x] Yes
[ ] No

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)

@ngrxbot
Copy link
Collaborator

ngrxbot commented Oct 14, 2019

Preview docs changes for fa218a7 at https://previews.ngrx.io/pr2164-fa218a7/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Oct 14, 2019

Preview docs changes for cae8460 at https://previews.ngrx.io/pr2164-cae8460/

modules/effects/src/effect_sources.ts Show resolved Hide resolved
modules/effects/src/effect_sources.ts Outdated Show resolved Hide resolved
modules/effects/spec/effect_sources.spec.ts Show resolved Hide resolved
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)
@timdeschryver timdeschryver force-pushed the pr/dispatch-init-effect branch from cf6f06c to 3789184 Compare January 13, 2020 20:02
@brandonroberts brandonroberts merged commit a528320 into master Jan 16, 2020
@brandonroberts brandonroberts deleted the pr/dispatch-init-effect branch January 16, 2020 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lazy loaded effect initialized multiple times if used in multiple routes
4 participants