Skip to content
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

Add reset state actions to our stores. #998

Merged
merged 12 commits into from
Mar 12, 2019
Merged

Conversation

nerrad
Copy link
Contributor

@nerrad nerrad commented Mar 4, 2019

Problem this Pull Request solves

While working on the demo app (#988) and the Barcode Scanner app (eventespresso/eea-barcode-scanner#7) I realized that there will be need for some sort of reset state action for our stores that allows dispatches to restore state to its default shape. For instance with the barcode scanner app the user might scan a new registration for checkin that we'll want to reset all the tracked related registrations etc in the state.

Note: a pull I did for GB recently that adds more sledgehammer like control over the resolution cache in the core/data store. It will make it easier for resetting that state in this pull. The downside is it will be tied to a version of WordPress so I can only use it IF the functions exist.

How has this been tested

  • unit test coverage
  • no impact to customer facing code.

Checklist

tn3rb
tn3rb previously approved these changes Mar 11, 2019
Copy link
Member

@tn3rb tn3rb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found one super minor grammer mistake in a comment, and had one suggestion regarding naming.
everything else looks good, but I can't claim to really understand what's going on.

going to approve this, but feel free to pass back for further review if you change any code

assets/src/data/eventespresso/core/reducers/relations.js Outdated Show resolved Hide resolved
assets/src/data/eventespresso/core/actions/reset.js Outdated Show resolved Hide resolved
@tn3rb tn3rb removed their assignment Mar 11, 2019
@nerrad nerrad merged commit 3b87d2d into master Mar 12, 2019
@nerrad nerrad deleted the FET/reset-state-action branch March 12, 2019 06:11
eeteamcodebase pushed a commit that referenced this pull request Mar 12, 2019
… state actions to our stores. (#998)

## Problem this Pull Request solves

While working on the demo app (#988) and the Barcode Scanner app (eventespresso/eea-barcode-scanner#7) I realized that there will be need for some sort of reset state action for our stores that allows dispatches to restore state to its default shape.  For instance with the barcode scanner app the user might scan a new registration for checkin that we'll want to reset all the tracked related registrations etc in the state.

Note: a [pull I did for GB](WordPress/gutenberg#14225) recently that adds more sledgehammer like control over the resolution cache in the `core/data` store.  It will make it easier for resetting that state in this pull.  The downside is it will be tied to a version of WordPress so I can only use it IF the functions exist.
"
@nerrad
Copy link
Contributor Author

nerrad commented Mar 12, 2019

@tn3rb I implemented your suggestions but then decided to go ahead and merge this (after verifying js tests passed) because the changes don't really need reviewed again.

@nerrad nerrad mentioned this pull request Mar 19, 2019
8 tasks
@nerrad nerrad added this to the 4.9.80.p milestone Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants