pcgbros-pbplus-member-ui
Version:
API sdk of PBPlus member plugin.
23 lines (17 loc) • 543 B
JavaScript
// AuthState.js
;
const defaultState = {isUserLoggedIn: false, endpoint: 'http://localhost:3000'};
const Reducer = (state = defaultState, action) => {
switch(action.type) {
case 'UPDATE_PBPLUS_AUTH_STATE':
return action.payload.authState;
break;
default:
return state;
}
}
const updateAuthState = ({ authState }) => {
return {type: 'UPDATE_PBPLUS_AUTH_STATE', payload: { authState }};
};
const Actions = { updateAuthState };
export default { Reducer, Actions };