import type { Fn, MethodParameters, UseAsync } from "./index.js"; import normalizeArgs from "./normalizeArgs.js"; import useAsyncSafe from "./useAsyncSafe.js"; export default normalizeArgs<"useAsync">(function useAsync( ...args: MethodParameters ): UseAsync { const [error, data] = useAsyncSafe(...args); if (error) { throw error; } return data as UseAsync; });