-
-
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
fix(Store): bootstrap store with partial initial state #1163
Conversation
modules/store/src/utils.ts
Outdated
@@ -1,117 +1,117 @@ | |||
import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what happened here? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert these changes
modules/store/src/utils.ts
Outdated
@@ -1,117 +1,117 @@ | |||
import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert these changes
modules/store/src/reducer_manager.ts
Outdated
private updateReducers(keys: string[]) { | ||
this.next(this.reducerFactory(this.reducers, this.initialState)); | ||
|
||
if (keys.length === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change. Currently there is one dispatch per reducer update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be sure, we want to keep dispatching every update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, dispatch individual updates for each key added. In V7, we'll change it to dispatch one action with an array of the added keys.
Don't know what's going on with the whitespace changes. Update the commit message also |
This changes the way features are added and removed.
Instead of adding/removing feature by feature, this adds/removes them in all together in batch.
With consequence that will only dispatch
@ngrx/store/update-reducers
once, if this isn't what we want we can still dispatch every feature one by one.The "original"
addFeature
,removeFeature
,addReducer
,removeReducer
methods will loop through the correspondingaddFeatures
,removeFeatures
,addReducers
,removeReducers
methods.Will it be beneficial to also add
addReducers
andremoveReducers
instore.ts
?This closes #906 and closes #909