p5.js-web-editor/client/modules/User/reducers.js
2016-06-22 15:58:23 -04:00

17 lines
No EOL
346 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;