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:
17
js/reducers/ErrorReducer.js
Normal file
17
js/reducers/ErrorReducer.js
Normal file
@ -0,0 +1,17 @@
|
||||
var ErrorConstants = require('../constants/ErrorConstants');
|
||||
|
||||
var Error = require('../models').Error;
|
||||
|
||||
module.exports = function(state = new Error(), action) {
|
||||
switch (action.type) {
|
||||
case ErrorConstants.ERROR_AJAX:
|
||||
case ErrorConstants.ERROR_SERVER:
|
||||
case ErrorConstants.ERROR_CLIENT:
|
||||
case ErrorConstants.ERROR_USER:
|
||||
return action.error;
|
||||
case ErrorConstants.CLEAR_ERROR:
|
||||
return new Error();
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user