mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
32 lines
495 B
JavaScript
32 lines
495 B
JavaScript
|
import ACTION_TYPES from './action-types';
|
||
|
|
||
|
const defaultState = {
|
||
|
isSaving: false,
|
||
|
data: {
|
||
|
step: 0,
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export const onboardingReducer = (
|
||
|
state = defaultState,
|
||
|
{ type, ...action }
|
||
|
) => {
|
||
|
switch ( type ) {
|
||
|
case ACTION_TYPES.SET_ONBOARDING_DETAILS:
|
||
|
return {
|
||
|
...state,
|
||
|
data: action.payload,
|
||
|
};
|
||
|
|
||
|
case ACTION_TYPES.SET_IS_SAVING_ONBOARDING_DETAILS:
|
||
|
return {
|
||
|
...state,
|
||
|
isSaving: action.isSaving,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
return state;
|
||
|
};
|
||
|
|
||
|
export default onboardingReducer;
|