feat(Effects): dispatch init feature effects action on init#1305
feat(Effects): dispatch init feature effects action on init#1305brandonroberts merged 4 commits intongrx:masterfrom
Conversation
| import { getSourceForInstance } from './effects_metadata'; | ||
|
|
||
| export const FEATURE_EFFECTS_INIT = '@ngrx/feature-effects/init'; | ||
| export type FeatureEffectsInit = { |
There was a problem hiding this comment.
The reason why I created this is to be typesafe, see the effects test case for a "demo".
99f391c to
0e4cdd2
Compare
| import { FEATURE_EFFECTS } from './tokens'; | ||
| import { getSourceForInstance } from './effects_metadata'; | ||
|
|
||
| export const FEATURE_EFFECTS_INIT = '@ngrx/feature-effects/init'; |
There was a problem hiding this comment.
I think the prefix should remain @ngrx/effects/something. What about @ngrx/effects/(update-effects or update)?
There was a problem hiding this comment.
Yea you're right.
My vote goes for @ngrx/effects/update-effects to keep things consistent with @ngrx/store/update-reducers.
Plus we wouldn't need to change the root effects:
I also would want to change the root effects action name (this will be a breaking change) to make it more clear that it's initiated by the root effects: from @ngrx/effects/init to @ngrx/root-effects/init
d17dac7 to
68f88c7
Compare
68f88c7 to
90ca432
Compare
docs/effects/api.md
Outdated
| ### UPDATE_EFFECTS | ||
|
|
||
| After feature effects have been registered, a `UPDATE_EFFECTS` action will be dispatched. | ||
| This action will have all registered effects as its payload. |
There was a problem hiding this comment.
Just to be sure, you mean that this can be removed right?
There was a problem hiding this comment.
No, just update. This action has all newly registered effects as its payload.
|
Nice. Just what i needed. |
|
Keep in mind this isn't released yet @ThomasBurleson - if you need it now you can install from the nightly builds. |
During a prod build the contructor name of an effect gets magnled, therefore this implementation can't be used.
During a prod build the contructor name of an effect gets magnled, therefore this implementation can't be used.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #683
What is the new behavior?
Does this PR introduce a breaking change?
Other information
If we agree on the API, I'll also add these changes to the docs.
I also would want to change the root effects action name (this will be a breaking change) to make it more clear that it's initiated by the root effects: from
@ngrx/effects/initto@ngrx/root-effects/init.Closes #683