mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
♻️ Rename store selectors
Selectors now only differentiate between persistent or transient data
This commit is contained in:
parent
a0dcfc1bad
commit
c5e8a85acf
4 changed files with 12 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
const EMPTY_OBJ = {};
|
||||
const EMPTY_OBJ = Object.freeze( {} );
|
||||
|
||||
const getOnboardingState = ( state ) => {
|
||||
if ( ! state ) {
|
||||
|
@ -8,10 +8,11 @@ const getOnboardingState = ( state ) => {
|
|||
return state.onboarding || EMPTY_OBJ;
|
||||
};
|
||||
|
||||
export const getOnboardingData = ( state ) => {
|
||||
export const getPersistentData = ( state ) => {
|
||||
return getOnboardingState( state ).data || EMPTY_OBJ;
|
||||
};
|
||||
|
||||
export const isSaving = ( state ) => {
|
||||
return getOnboardingState( state ).isSaving || false;
|
||||
export const getTransientData = ( state ) => {
|
||||
const { data, ...transientState } = getOnboardingState( state );
|
||||
return transientState || EMPTY_OBJ;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue