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

17 lines
346 B
JavaScript
Raw Normal View History

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