fix(Store): bootstrap store with partial initial state#1163
Merged
brandonroberts merged 9 commits intongrx:masterfrom Jul 13, 2018
Merged
fix(Store): bootstrap store with partial initial state#1163brandonroberts merged 9 commits intongrx:masterfrom
brandonroberts merged 9 commits intongrx:masterfrom
Conversation
timdeschryver
commented
Jun 30, 2018
| @@ -1,117 +1,117 @@ | |||
| import { | |||
Member
Author
There was a problem hiding this comment.
I don't know what happened here? 😅
brandonroberts
requested changes
Jul 5, 2018
| @@ -1,117 +1,117 @@ | |||
| import { | |||
modules/store/src/reducer_manager.ts
Outdated
| private updateReducers(keys: string[]) { | ||
| this.next(this.reducerFactory(this.reducers, this.initialState)); | ||
|
|
||
| if (keys.length === 1) { |
Member
There was a problem hiding this comment.
This would be a breaking change. Currently there is one dispatch per reducer update.
Member
Author
There was a problem hiding this comment.
To be sure, we want to keep dispatching every update?
Member
There was a problem hiding this comment.
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.
Member
|
Don't know what's going on with the whitespace changes. Update the commit message also |
brandonroberts
approved these changes
Jul 13, 2018
timdeschryver
added a commit
to timdeschryver/platform
that referenced
this pull request
Jul 15, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-reducersonce, if this isn't what we want we can still dispatch every feature one by one.The "original"
addFeature,removeFeature,addReducer,removeReducermethods will loop through the correspondingaddFeatures,removeFeatures,addReducers,removeReducersmethods.Will it be beneficial to also add
addReducersandremoveReducersinstore.ts?This closes #906 and closes #909