mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
🎨 Small code cleanup
This commit is contained in:
parent
3fa823ee02
commit
454e7c1a6d
2 changed files with 14 additions and 60 deletions
|
@ -101,11 +101,9 @@ export const setClientSecret = ( clientSecret ) => ( {
|
||||||
* @return {Action} The action.
|
* @return {Action} The action.
|
||||||
*/
|
*/
|
||||||
export const persist = function* () {
|
export const persist = function* () {
|
||||||
yield setIsBusy( true );
|
const data = yield select( STORE_NAME ).persistentData();
|
||||||
yield {
|
|
||||||
type: ACTION_TYPES.DO_PERSIST_DATA,
|
yield { type: ACTION_TYPES.DO_PERSIST_DATA, data };
|
||||||
};
|
|
||||||
yield setIsBusy( false );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,17 +25,6 @@ import { STORE_NAME } from './constants';
|
||||||
*/
|
*/
|
||||||
export const reset = () => ( { type: ACTION_TYPES.RESET } );
|
export const reset = () => ( { type: ACTION_TYPES.RESET } );
|
||||||
|
|
||||||
/**
|
|
||||||
* Transient. Marks the onboarding details as "ready", i.e., fully initialized.
|
|
||||||
*
|
|
||||||
* @param {boolean} isReady
|
|
||||||
* @return {Action} The action.
|
|
||||||
*/
|
|
||||||
export const setIsReady = ( isReady ) => ( {
|
|
||||||
type: ACTION_TYPES.SET_TRANSIENT,
|
|
||||||
payload: { isReady },
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persistent. Set the full onboarding details, usually during app initialization.
|
* Persistent. Set the full onboarding details, usually during app initialization.
|
||||||
*
|
*
|
||||||
|
@ -47,6 +36,17 @@ export const hydrate = ( payload ) => ( {
|
||||||
payload,
|
payload,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transient. Marks the onboarding details as "ready", i.e., fully initialized.
|
||||||
|
*
|
||||||
|
* @param {boolean} isReady
|
||||||
|
* @return {Action} The action.
|
||||||
|
*/
|
||||||
|
export const setIsReady = ( isReady ) => ( {
|
||||||
|
type: ACTION_TYPES.SET_TRANSIENT,
|
||||||
|
payload: { isReady },
|
||||||
|
} );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persistent.Set the "onboarding completed" flag which shows or hides the wizard.
|
* Persistent.Set the "onboarding completed" flag which shows or hides the wizard.
|
||||||
*
|
*
|
||||||
|
@ -69,50 +69,6 @@ export const setStep = ( step ) => ( {
|
||||||
payload: { step },
|
payload: { step },
|
||||||
} );
|
} );
|
||||||
|
|
||||||
/**
|
|
||||||
* Persistent. Sets the sandbox mode on or off.
|
|
||||||
*
|
|
||||||
* @param {boolean} useSandbox
|
|
||||||
* @return {Action} The action.
|
|
||||||
*/
|
|
||||||
export const setSandboxMode = ( useSandbox ) => ( {
|
|
||||||
type: ACTION_TYPES.SET_PERSISTENT,
|
|
||||||
payload: { useSandbox },
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Persistent. Toggles the "Manual Connection" mode on or off.
|
|
||||||
*
|
|
||||||
* @param {boolean} useManualConnection
|
|
||||||
* @return {Action} The action.
|
|
||||||
*/
|
|
||||||
export const setManualConnectionMode = ( useManualConnection ) => ( {
|
|
||||||
type: ACTION_TYPES.SET_PERSISTENT,
|
|
||||||
payload: { useManualConnection },
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Persistent. Changes the "client ID" value.
|
|
||||||
*
|
|
||||||
* @param {string} clientId
|
|
||||||
* @return {Action} The action.
|
|
||||||
*/
|
|
||||||
export const setClientId = ( clientId ) => ( {
|
|
||||||
type: ACTION_TYPES.SET_PERSISTENT,
|
|
||||||
payload: { clientId },
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Persistent. Changes the "client secret" value.
|
|
||||||
*
|
|
||||||
* @param {string} clientSecret
|
|
||||||
* @return {Action} The action.
|
|
||||||
*/
|
|
||||||
export const setClientSecret = ( clientSecret ) => ( {
|
|
||||||
type: ACTION_TYPES.SET_PERSISTENT,
|
|
||||||
payload: { clientSecret },
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persistent. Sets the "isCasualSeller" value.
|
* Persistent. Sets the "isCasualSeller" value.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue