-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
b0308c1
to
d160e3d
Compare
155d6b0
to
ecb625f
Compare
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.
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
- for RESET_ALL_STATE - for RESET_ALL_STATE_FOR_MODEL
ecb625f
to
88f8bd6
Compare
… 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. "
@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. |
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
Checklist
esc_html__()
, see https://codex.wordpress.org/I18n_for_WordPress_Developers)