mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
✨ Create the generic setter-actions
This commit is contained in:
parent
f07d9bad82
commit
96128ee3e4
1 changed files with 24 additions and 0 deletions
|
@ -36,6 +36,30 @@ export const hydrate = ( payload ) => ( {
|
||||||
payload,
|
payload,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic transient-data updater.
|
||||||
|
*
|
||||||
|
* @param {string} prop Name of the property to update.
|
||||||
|
* @param {any} value The new value of the property.
|
||||||
|
* @return {Action} The action.
|
||||||
|
*/
|
||||||
|
export const setTransient = ( prop, value ) => ( {
|
||||||
|
type: ACTION_TYPES.SET_TRANSIENT,
|
||||||
|
payload: { [ prop ]: value },
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic persistent-data updater.
|
||||||
|
*
|
||||||
|
* @param {string} prop Name of the property to update.
|
||||||
|
* @param {any} value The new value of the property.
|
||||||
|
* @return {Action} The action.
|
||||||
|
*/
|
||||||
|
export const setPersistent = ( prop, value ) => ( {
|
||||||
|
type: ACTION_TYPES.SET_PERSISTENT,
|
||||||
|
payload: { [ prop ]: value },
|
||||||
|
} );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transient. Marks the store as "ready", i.e., fully initialized.
|
* Transient. Marks the store as "ready", i.e., fully initialized.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue