lunch/js/reducers/SessionReducer.js

15 lines
346 B
JavaScript
Raw Normal View History

2016-12-22 21:22:47 -05:00
var UserConstants = require('../constants/UserConstants');
var Session = require('../models').Session;
module.exports = function(state = new Session(), action) {
switch (action.type) {
case UserConstants.USER_LOGGEDIN:
return action.session;
case UserConstants.USER_LOGGEDOUT:
return new Session();
default:
return state;
}
};