@zohodesk/hooks
Version:
Unified Component Library - Hooks
17 lines • 399 B
JavaScript
import { FAILED, SUCCESS } from "./constants";
export const initalState = {
isImageFailed: false
};
export default function reducer(state, action) {
if (action.type === FAILED) {
let newState = { ...state,
isImageFailed: true
};
return newState;
} else if (action.type === SUCCESS) {
let newState = { ...state,
isImageFailed: false
};
return newState;
}
}