29 lines
612 B
TypeScript
Raw Normal View History

import { Action as ReduxPopup } from 'redux';
2019-12-07 13:28:52 +02:00
import { PopupConfig } from './reducer';
interface PopupCreateAction extends ReduxPopup {
type: 'POPUP_CREATE';
payload: PopupConfig;
}
export function create(popup: PopupConfig): PopupCreateAction {
2019-12-07 13:28:52 +02:00
return {
type: 'POPUP_CREATE',
payload: popup,
2019-12-07 13:28:52 +02:00
};
}
interface PopupDestroyAction extends ReduxPopup {
type: 'POPUP_DESTROY';
payload: PopupConfig;
}
export function destroy(popup: PopupConfig): PopupDestroyAction {
2019-12-07 13:28:52 +02:00
return {
type: 'POPUP_DESTROY',
2019-12-07 13:28:52 +02:00
payload: popup,
};
}
export type Action = PopupCreateAction | PopupDestroyAction;