UNPKG

@grigorov-it/mazer

Version:

Free and Open-source Bootstrap 5 Admin Dashboard Template and Landing Page

24 lines (18 loc) 460 B
import { SetIsLoadingAction } from '../actions/misc'; import { State } from '../interfaces/state'; export const defaultState = false; type ActionTypes = SetIsLoadingAction | Record<string, never>; const general = ( state = defaultState, action: ActionTypes = {}, ): State['loading'] => { switch (action.type) { case 'SET_IS_LOADING': { return action.isLoading; } default: { return state; } } }; export default general;