Still working on Auth State

This commit is contained in:
2019-10-02 17:53:20 -04:00
parent dcd03d7888
commit 5df28e0e77
12 changed files with 363 additions and 60 deletions

View File

@@ -0,0 +1,30 @@
import { SET_ERRORS, CLEAR_ERRORS, LOADING_UI } from '../types';
const initialState = {
loading: false,
errors: null
};
export default function(state = initialState, action) {
switch(action.type) {
case SET_ERRORS:
return {
...state,
loading: false,
errors: action.payload
};
case CLEAR_ERRORS:
return {
...state,
loading: false,
errors: null
};
case LOADING_UI:
return {
...state,
loading: true
}
default:
return state;
}
}