2019-12-23 19:22:54 +01:00
|
|
|
import { ACTION_TYPES } from '../constants';
|
2021-12-17 22:26:52 +01:00
|
|
|
import { State } from '../interfaces/state';
|
2019-12-23 19:22:54 +01:00
|
|
|
|
|
|
|
export interface ClearAllAction {
|
|
|
|
type: typeof ACTION_TYPES.CLEAR_ALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ResetToAction {
|
|
|
|
type: typeof ACTION_TYPES.RESET_TO;
|
|
|
|
state: State;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SetIsLoadingAction {
|
|
|
|
type: typeof ACTION_TYPES.SET_IS_LOADING;
|
|
|
|
isLoading: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const clearAll = (): ClearAllAction => ({
|
|
|
|
type: ACTION_TYPES.CLEAR_ALL,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const resetTo = (state: State): ResetToAction => ({
|
|
|
|
type: ACTION_TYPES.RESET_TO,
|
|
|
|
state,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const setIsLoading = (isLoading: boolean): SetIsLoadingAction => ({
|
|
|
|
type: ACTION_TYPES.SET_IS_LOADING,
|
|
|
|
isLoading,
|
|
|
|
});
|