Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
primogenial
/
wp-content-20241001222009
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
packages
/
checkout
/
utils
:
extension-cart-update.ts
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * External dependencies */ import { dispatch } from '@wordpress/data'; import { CartResponse } from '@woocommerce/type-defs/cart-response'; import { ExtensionCartUpdateArgs } from '@woocommerce/types'; /** * Internal dependencies */ import { STORE_KEY } from '../../../assets/js/data/cart/constants'; /** * When executed, this will call the cart/extensions endpoint. * The args contains a namespace, so if that extension has registered an update * callback, it will be executed server-side and the new cart will be returned. * The new cart is then received into the client-side store. */ export const extensionCartUpdate = ( args: ExtensionCartUpdateArgs ): Promise< CartResponse > => { const { applyExtensionCartUpdate } = dispatch( STORE_KEY ); return applyExtensionCartUpdate( args ); };