Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Porter97
Last active March 30, 2020 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/c2d184eefe9227c5bb579cf64f73cbd1 to your computer and use it in GitHub Desktop.
Save Porter97/c2d184eefe9227c5bb579cf64f73cbd1 to your computer and use it in GitHub Desktop.
export default (state = {}, action) => {
switch (action.type) {
case 'REGISTER':
return {
...state,
inProgress: false,
errors: action.error ? action.payload.errors : null
};
case 'UPDATE_FIELD_AUTH':
return {...state, [action.key]: action.value};
case 'ASYNC_START':
if (action.subtype === 'REGISTER') {
return { ...state, inProgress: true };
}
break;
default:
return state;
}
return state;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment