Last active
March 30, 2020 19:04
-
-
Save Porter97/c2d184eefe9227c5bb579cf64f73cbd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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