@bbcs-dev/mediator
Version:
This package brings the mediator pattern to React typescript
4 lines (3 loc) • 339 B
TypeScript
import { Dispatch, SetStateAction } from 'react';
export declare const useMediator: <TRequest, TResponse>(event: string, body: TRequest) => TResponse | undefined;
export declare const useMediatorWithState: <TRequest, TResponse>(event: string, body: TRequest) => (TResponse | Dispatch<SetStateAction<TResponse | undefined>> | undefined)[];