simba-mobile-cud/app/redux/reducers/EpargnerArgentUserReducer.js

34 lines
956 B
JavaScript
Raw Normal View History

2025-01-07 09:47:45 +00:00
import { EPARGNER_ARGENT_USER_PENDING, EPARGNER_ARGENT_USER_SUCCESS, EPARGNER_ARGENT_USER_ERROR, EPARGNER_ARGENT_USER_RESET } from "../types/NanoCreditType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case EPARGNER_ARGENT_USER_PENDING: return {
...state,
loading: true
}
case EPARGNER_ARGENT_USER_SUCCESS: return {
...state,
loading: false,
result: action.result.data,
error: null
}
case EPARGNER_ARGENT_USER_ERROR: return {
...state,
loading: false,
result: null,
error: action.result
}
case EPARGNER_ARGENT_USER_RESET: return initialState;
default: {
return state;
}
}
};