react-async-ui
Version:
Asynchronous React hooks to manage modal UI state
14 lines (13 loc) • 438 B
TypeScript
import { type AsyncModalProps } from './AsyncModalProps';
/**
* Interaction state for a modal UI element as managed by `useAsyncModalState`.
* Indicates whether the modal is currently open and contains invocation arguments
* and callbacks to resolve/reject the interaction.
*/
export type AsyncModalState<TValue, TResult> = {
isOpen: true;
props: AsyncModalProps<TValue, TResult>;
} | {
isOpen: false;
props: null;
};