ToggleLoading.js
397 Bytes
const TOGGLE_LOADING = 'ToggleLoading/TOGGLE';
export const toggleLoading = () => ({ type: TOGGLE_LOADING,})
const initialState = {
isLoading: false,
};
export default ToggleLoading = (state = initialState, action) => {
switch (action.type) {
case TOGGLE_LOADING:
return { isLoading: !initialState.isLoading };
default:
return state;
}
}