Skip to content

Conversation

@prescottprue
Copy link
Owner

Description

Check List

If not relevant to pull request, check off as complete

  • All tests passing
  • Docs updated with any changes or examples if applicable
  • Added tests to ensure new feature(s) work properly

Relevant Issues

…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
Copy link

codecov bot commented Nov 10, 2017

Codecov Report

Merging #334 into v2.0.0 will increase coverage by 1.48%.
The diff coverage is 85.71%.

@@            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 }
Copy link
Collaborator

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?

Copy link
Owner Author

@prescottprue prescottprue Nov 11, 2017

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?

@prescottprue prescottprue changed the title V2.0.0 beta.17 v2.0.0-beta.17 Nov 12, 2017
@prescottprue prescottprue merged commit 11ee53a into v2.0.0 Nov 12, 2017
@prescottprue prescottprue deleted the v2.0.0-beta.17 branch November 12, 2017 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants