Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Move CheckoutStateProvider into a data store and create a hook to interact with the store #6104

Closed
4 tasks
opr opened this issue Mar 23, 2022 · 1 comment · Fixed by #6232
Closed
4 tasks
Assignees
Labels
block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. category: extensibility Work involving adding or updating extensibility. Useful to combine with other scopes impacted. status: stale Stale issues and PRs have had no updates for 60 days.

Comments

@opr
Copy link
Contributor

opr commented Mar 23, 2022

CheckoutStateProvider should be moved into a data store and a hook should be created to abstract interaction with it.

There is an existing reducer related to this context provider found in this file https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/5dac3a0e74e2de9c4a4bfecca3f15b380b05433f/assets/js/base/context/providers/cart-checkout/checkout-state/reducer.ts which should be moved into the reducer used by @wordpress/data.

Sub-tasks required to solve this issue

  • Create data store
  • Refactor existing reducer into the one used by the data store above
  • Implement actions and selectors for values that the context previously returned
  • Create a hook that can be used to easily interact with the data store (reducing the need for repeated use of useSelect and useDispatch)
@opr opr added category: extensibility Work involving adding or updating extensibility. Useful to combine with other scopes impacted. block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. labels Mar 23, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.

@github-actions github-actions bot added the status: stale Stale issues and PRs have had no updates for 60 days. label Jul 4, 2022
@opr opr reopened this Jul 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. category: extensibility Work involving adding or updating extensibility. Useful to combine with other scopes impacted. status: stale Stale issues and PRs have had no updates for 60 days.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants