Initial commit of eigent-main

This commit is contained in:
puzhen 2025-08-12 01:16:39 +02:00
commit 723df5a03e
1144 changed files with 103478 additions and 0 deletions

View file

@ -0,0 +1,23 @@
// src/hooks/use-async-external-store.tsx
import { useEffect, useState } from "react";
import { AsyncResult } from "../utils/results";
function useAsyncExternalStore(subscribe) {
const [isAvailable, setIsAvailable] = useState(false);
const [value, setValue] = useState();
useEffect(() => {
const unsubscribe = subscribe((value2) => {
setValue(() => value2);
setIsAvailable(() => true);
});
return unsubscribe;
}, [subscribe]);
if (isAvailable) {
return AsyncResult.ok(value);
} else {
return AsyncResult.pending();
}
}
export {
useAsyncExternalStore
};
//# sourceMappingURL=use-async-external-store.js.map