mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 16:24:33 +08:00
Axo Block: Improve code comments and fix minor misc bugs
This commit is contained in:
parent
1f3034136e
commit
2436ceb487
29 changed files with 449 additions and 39 deletions
|
@ -1,5 +1,13 @@
|
|||
import { useEffect, useCallback } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Custom hook to handle payment setup effects in the checkout flow.
|
||||
*
|
||||
* @param {Function} onPaymentSetup - Function to subscribe to payment setup events.
|
||||
* @param {Function} handlePaymentSetup - Callback to process payment setup.
|
||||
* @param {Function} setPaymentComponent - Function to update the payment component state.
|
||||
* @return {Object} Object containing the handlePaymentLoad function.
|
||||
*/
|
||||
const usePaymentSetupEffect = (
|
||||
onPaymentSetup,
|
||||
handlePaymentSetup,
|
||||
|
@ -17,6 +25,11 @@ const usePaymentSetupEffect = (
|
|||
};
|
||||
}, [ onPaymentSetup, handlePaymentSetup ] );
|
||||
|
||||
/**
|
||||
* Callback function to handle payment component loading.
|
||||
*
|
||||
* @param {Object} component - The loaded payment component.
|
||||
*/
|
||||
const handlePaymentLoad = useCallback(
|
||||
( component ) => {
|
||||
setPaymentComponent( component );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue