mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Still working on Auth State
This commit is contained in:
30
twistter-frontend/src/redux/reducers/uiReducer.js
Normal file
30
twistter-frontend/src/redux/reducers/uiReducer.js
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user