mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-01 20:08:39 -04:00
Hook (almost) everything up to Redux
This commit is contained in:
15
js/reducers/UserReducer.js
Normal file
15
js/reducers/UserReducer.js
Normal file
@ -0,0 +1,15 @@
|
||||
var UserConstants = require('../constants/UserConstants');
|
||||
|
||||
var User = require('../models').User;
|
||||
|
||||
module.exports = function(state = new User(), action) {
|
||||
switch (action.type) {
|
||||
case UserConstants.USER_FETCHED:
|
||||
case UserConstants.USER_UPDATED:
|
||||
return action.user;
|
||||
case UserConstants.USER_LOGGEDOUT:
|
||||
return new User();
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user