mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-02 20:28:38 -04:00
Hook (almost) everything up to Redux
This commit is contained in:
14
js/reducers/SessionReducer.js
Normal file
14
js/reducers/SessionReducer.js
Normal file
@ -0,0 +1,14 @@
|
||||
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;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user