-
-
Notifications
You must be signed in to change notification settings - Fork 553
v2.0.0-beta.17 #334
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
v2.0.0-beta.17 #334
Conversation
…ed - #310 * feat(populate): support for populating ordered data with multiple populates where one populate child missing * feat(tests): Unit tests added for populating ordered data
…state - #301 * feat(tests): test added to check profile state consistency on LOGIN dispatch - #301 * fix(auth): UNLOAD_PROFILE action type no longer dispatched (did help with #301) * feat(config): preserveOnLogin config option added to allow preserving of pieces of state affected by LOGIN action (called by login action creator) * feat(tests): tests added for getVal helper
Codecov Report
@@ Coverage Diff @@
## v2.0.0 #334 +/- ##
==========================================
+ Coverage 81.83% 83.32% +1.48%
==========================================
Files 22 22
Lines 2219 2225 +6
Branches 338 344 +6
==========================================
+ Hits 1816 1854 +38
+ Misses 403 371 -32 |
src/reducer.js
Outdated
| if (action.preserve && action.preserve.auth) { | ||
| return pick({ ...state, ...auth }, action.preserve.auth) // pick returns a new object | ||
| } | ||
| return { ...state, ...auth, isEmpty: false, isLoaded: true } |
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.
before we were returning { ...auth, isEmpty: false, isLoaded: true } and now we are returning { ...state, ...auth, isEmpty: false, isLoaded: true }. Any reason we added ...state?
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.
Great question! The goal was to preserve anything in state that was there, as well as spread the new parameters onto it. I think that this doesn't really offer that much advantage, and could be unclear to some, so I am going to change it back.
I think it still makes sense to pass { ...state, ...auth } to pick though since some want to be able to preserve isLoaded state and potentially other things that were already in state. What are your thoughts?
Description
UNLOAD_PROFILEaction type no longer dispatched (did not fix issue) - bug(profile) inconsistent profile isLoaded, isEmpty states #301preserveOnLoginconfig option added to allow preserving of pieces of state affected byLOGINaction (called byloginaction creator)LOGINdispatch - bug(profile) inconsistent profile isLoaded, isEmpty states #301getValhelperCheck List
If not relevant to pull request, check off as complete
Relevant Issues