Skip to content

fix(reducer): MERGE action added and SET action to reverted to v1 behavior #255

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

Merged
merged 3 commits into from
Aug 27, 2017

Conversation

marekolszewski
Copy link

@marekolszewski marekolszewski commented Aug 24, 2017

Description

I previously made the v2.0.0 SET action merge redux state data rather than overwrite it. This fixed a bug with multiple queries using population (and likely also issue #130), but it had unintended consequences for regular data subscriptions (most notably: if a field is deleted from a single object being subscribed to, it won't get deleted by the reducer).

This PR reverts that change and introduces a new MERGE action that keeps this merge semantics when useful. For now, I use MERGE when populating data only to fix the aforementioned bug. Down the road, it can be exposed to end-users as an option in a query. This may be useful, for example, when subscribing to collections of objects that one might not want to overwrite across different containers.

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

@marekolszewski marekolszewski changed the title fix(reducer) Changed data reducer to merge new data before set to avoid needless cloning fix(reducer) v2 Added new MERGE action and reverted SET action to v1 behavior Aug 25, 2017
@prescottprue prescottprue changed the title fix(reducer) v2 Added new MERGE action and reverted SET action to v1 behavior fix(reducer): MERGE action added and SET action to reverted to v1 behavior Aug 27, 2017
@prescottprue prescottprue changed the base branch from v2.0.0 to v2.0.0-beta.8 August 27, 2017 22:00
@prescottprue prescottprue self-assigned this Aug 27, 2017
@prescottprue prescottprue merged commit f64239b into prescottprue:v2.0.0-beta.8 Aug 27, 2017
@prescottprue prescottprue mentioned this pull request Sep 1, 2017
3 tasks
prescottprue added a commit that referenced this pull request Sep 2, 2017
* fix(reducer): `MERGE` action added and `SET` action to reverted to v1 behavior - #255
* feat(populate): population of ordered data - #239
* feat(populate) populate once queries - #256
* feat(auth): emptyOnLogin config option added (defaults to `true`) - #254
* feat(query): emit `NO_VALUE` for `once` queries that are empty - #265
* fix(populate) Fixed populate function to return null for null paths
* app instance handling now uses `firebase_` instead of `extendApp` (more functionality) - #250
* Removed no longer in use code from v1 (validateConfig)
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.

2 participants