p5.js-web-editor/client/modules/User/reducers.js

17 lines
346 B
JavaScript
Raw Normal View History

2016-06-22 19:58:23 +00:00
import * as ActionTypes from '../../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;