38 lines
737 B
JavaScript
38 lines
737 B
JavaScript
const actions = require('./actions');
|
|
|
|
const defaultAccount = null;
|
|
function accountReducer(state = defaultAccount, action) {
|
|
switch (action.type) {
|
|
case actions.SET_ACCOUNT:
|
|
return action.value;
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
const defaultCryps = null;
|
|
function crypsReducer(state = defaultCryps, action) {
|
|
switch (action.type) {
|
|
case actions.SET_CRYPS:
|
|
return action.value;
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
const defaultWs = null;
|
|
function wsReducer(state = defaultWs, action) {
|
|
switch (action.type) {
|
|
case actions.SET_WS:
|
|
return action.value;
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
accountReducer,
|
|
crypsReducer,
|
|
wsReducer,
|
|
};
|