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