mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-15 20:16:39 +02:00
24 lines
425 B
TypeScript
24 lines
425 B
TypeScript
|
import { SetIsLoadingAction } from '../actions/misc';
|
||
|
import { State } from '../interfaces';
|
||
|
|
||
|
export const defaultState = false;
|
||
|
|
||
|
type ActionTypes = SetIsLoadingAction;
|
||
|
|
||
|
const general = (
|
||
|
state = defaultState,
|
||
|
action: ActionTypes,
|
||
|
): State['loading'] => {
|
||
|
switch (action.type) {
|
||
|
case 'SET_IS_LOADING': {
|
||
|
return action.isLoading;
|
||
|
}
|
||
|
|
||
|
default: {
|
||
|
return state;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default general;
|