mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-03 14:32:11 +02:00
28 lines
469 B
TypeScript
28 lines
469 B
TypeScript
import { SetIsLoadingAction } from '../actions/misc';
|
|
import { State } from '../interfaces';
|
|
|
|
export const defaultState = {
|
|
loading: false,
|
|
};
|
|
|
|
type ActionTypes = SetIsLoadingAction;
|
|
|
|
const general = (
|
|
state = defaultState,
|
|
action: ActionTypes,
|
|
): State['general'] => {
|
|
switch (action.type) {
|
|
case 'SET_IS_LOADING': {
|
|
return {
|
|
loading: action.isLoading,
|
|
};
|
|
}
|
|
|
|
default: {
|
|
return state;
|
|
}
|
|
}
|
|
};
|
|
|
|
export default general;
|