p5.js-web-editor/client/modules/User/reducers.js
2016-06-23 18:29:55 -04:00

17 lines
383 B
JavaScript

import * as ActionTypes from '../../constants';
const user = (state = { authenticated: false }, action) => {
switch (action.type) {
case ActionTypes.AUTH_USER:
return { ...action.user,
authenticated: true };
case ActionTypes.AUTH_ERROR:
return {
authenticated: false
};
default:
return state;
}
};
export default user;