p5.js-web-editor/shared/redux/reducers/user.js

17 lines
353 B
JavaScript
Raw Normal View History

import * as ActionTypes from '../constants/constants'
2016-06-14 18:46:40 +00:00
const user = (state = {authenticated: false}, action) => {
switch (action.type) {
case ActionTypes.AUTH_USER:
2016-06-14 18:46:40 +00:00
return { ...action.user,
authenticated: true };
case ActionTypes.AUTH_ERROR:
return {
authenticated: false
}
default:
return state;
}
}
export default user;