ilink-world/redux/reducers/GetHyperSuperHistoryReducer.js

34 lines
1006 B
JavaScript
Raw Normal View History

2020-10-16 17:57:16 +00:00
import { WALLET_HISTORY_HYPER_SUPER_PENDING, WALLET_HISTORY_HYPER_SUPER__RESET, WALLET_HISTORY_HYPER_SUPER__ERROR, WALLET_HISTORY_HYPER_SUPER__SUCCESS } from "../types/WalletType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case WALLET_HISTORY_HYPER_SUPER_PENDING: return {
...state,
loading: true
}
case WALLET_HISTORY_HYPER_SUPER__SUCCESS: return {
...state,
loading: false,
result: action.result.data,
error: null
}
case WALLET_HISTORY_HYPER_SUPER__ERROR: return {
...state,
loading: false,
result: null,
error: action.result
}
case WALLET_HISTORY_HYPER_SUPER__RESET: return initialState;
default: {
return state;
}
}
};