refun
Version:
A collection of React Hook-enabled functions that compose harmoniously with each other. Similar to `recompose`, but:
9 lines (8 loc) • 365 B
TypeScript
import type { TExtend } from 'tsfn';
export declare type TActualHandlers<T> = {
[key in keyof T]: (...args: any[]) => void;
};
export declare type THandlers<P> = {
[key: string]: (props: P) => (...args: any[]) => void;
};
export declare const mapHandlers: <P extends {}, R extends THandlers<P>>(handlers: R) => (props: P) => TExtend<P, TActualHandlers<R>>;