diff --git a/assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts b/assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts index 3f12795521a..300d98c0358 100644 --- a/assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts +++ b/assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts @@ -53,15 +53,17 @@ export const useStoreCartItemQuantity = ( const { key: cartItemKey = '', quantity: cartItemQuantity = 1 } = verifiedCartItem; const { cartErrors } = useStoreCart(); - const { incrementCalculating, decrementCalculating } = - useDispatch( CHECKOUT_STORE_KEY ); + const { incrementCalculating, decrementCalculating } = useDispatch( + CHECKOUT_STORE_KEY + ); // Store quantity in hook state. This is used to keep the UI updated while server request is updated. const [ quantity, setQuantity ] = useState< number >( cartItemQuantity ); const [ debouncedQuantity ] = useDebounce< number >( quantity, 400 ); const previousDebouncedQuantity = usePrevious( debouncedQuantity ); - const { removeItemFromCart, changeCartItemQuantity } = - useDispatch( CART_STORE_KEY ); + const { removeItemFromCart, changeCartItemQuantity } = useDispatch( + CART_STORE_KEY + ); // Update local state when server updates. useEffect( () => setQuantity( cartItemQuantity ), [ cartItemQuantity ] ); diff --git a/assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts b/assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts index 75ea85c466d..d265af79123 100644 --- a/assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts +++ b/assets/js/base/context/hooks/payment-methods/use-payment-method-interface.ts @@ -10,6 +10,7 @@ import { getSetting } from '@woocommerce/settings'; import deprecated from '@wordpress/deprecated'; import LoadingMask from '@woocommerce/base-components/loading-mask'; import type { PaymentMethodInterface } from '@woocommerce/types'; +import { useSelect } from '@wordpress/data'; import { useSelect, useDispatch } from '@wordpress/data'; import { CHECKOUT_STORE_KEY, diff --git a/assets/js/data/checkout/constants.ts b/assets/js/data/checkout/constants.ts index 2ce943bc6ef..76622d3dc09 100644 --- a/assets/js/data/checkout/constants.ts +++ b/assets/js/data/checkout/constants.ts @@ -8,7 +8,7 @@ import { CheckoutResponseSuccess } from '@woocommerce/types'; export const STORE_KEY = 'wc/store/checkout'; export enum STATUS { - // Checkout is in it's initialized state. + // Checkout is in its initialized state. PRISTINE = 'pristine', // When checkout state has changed but there is no activity happening. IDLE = 'idle', diff --git a/assets/js/data/checkout/reducers.ts b/assets/js/data/checkout/reducers.ts index 784825426f2..7f2a4db12ca 100644 --- a/assets/js/data/checkout/reducers.ts +++ b/assets/js/data/checkout/reducers.ts @@ -2,8 +2,8 @@ * External dependencies */ import type { Reducer } from 'redux'; - import { PaymentResult } from '@woocommerce/types'; + /** * Internal dependencies */ diff --git a/assets/js/data/tsconfig.json b/assets/js/data/tsconfig.json index d0c46e11520..b4e9393321f 100644 --- a/assets/js/data/tsconfig.json +++ b/assets/js/data/tsconfig.json @@ -10,7 +10,8 @@ "../base/context/providers/cart-checkout/payment-methods/**.ts", "../utils/notices.ts", "../base/context/providers/cart-checkout/checkout-events/**.ts", - "../base/context/event-emit" + "../base/context/event-emit", + "../base/context/providers/cart-checkout/checkout-state/utils.ts" ], "exclude": [ "**/test/**" ] } diff --git a/docs/internal-developers/block-client-apis/checkout/checkout-api.md b/docs/internal-developers/block-client-apis/checkout/checkout-api.md index 85aa7a4a45d..7920b53ff8d 100644 --- a/docs/internal-developers/block-client-apis/checkout/checkout-api.md +++ b/docs/internal-developers/block-client-apis/checkout/checkout-api.md @@ -1,9 +1,12 @@ # Checkout API interface +<<<<<<< HEAD **Note on migration:** We are in the process of moving much of the data from contexts into data stores, so this portion of the docs may change often as we do this. We will endavour to keep it up to date while the work is carried out ## Table of Contents +**Note on migration:** We are in the process of moving much of the data from contexts into data stores, so this portion of the docs may change often as we do this. We will endavour to keep it up to date while the work is carried out + - [Checkout Block API overview](#checkout-block-api-overview) - [Data Stores](#data-stores) - [Checkout Data Store](#checkout-data-store)