mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 13:15:05 +00:00
28 lines
688 B
JavaScript
28 lines
688 B
JavaScript
import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI, SET_AUTHENTICATED, SET_UNAUTHENTICATED} from '../types';
|
|
|
|
const initialState = {
|
|
authenticated: false,
|
|
credentials: {},
|
|
likes: [],
|
|
notifications: []
|
|
};
|
|
|
|
export default function(state = initialState, action) {
|
|
switch(action.type) {
|
|
case SET_AUTHENTICATED:
|
|
return {
|
|
...state,
|
|
authenticated: true,
|
|
|
|
};
|
|
case SET_UNAUTHENTICATED:
|
|
return initialState;
|
|
case SET_USER:
|
|
return {
|
|
authenticated: true,
|
|
...action.payload,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
} |