Better hub

This commit is contained in:
2025-10-26 20:22:25 +01:00
parent 5a614cb4eb
commit 1581938c64
2 changed files with 126 additions and 13 deletions
+19
View File
@@ -0,0 +1,19 @@
"use client";
import useAsync from "@/hooks/use-async";
export default function AsyncValue<T, E = any>({
func,
render,
}: Readonly<{
func: () => Promise<T>;
render: ({
loading,
}: {
value: T | undefined;
loading: boolean;
error: E | undefined;
}) => React.ReactNode;
}>) {
return render(useAsync(func));
}