import { extractString } from "@common/utils";
import { useCallback } from "preact/hooks";

export const useInputCallback = <T>(callback: (value: string) => T, deps: any[]): ((value: string | Event) => T) => (
    useCallback((e: Event | string) => callback(extractString(e)), deps)
);
