feat: migrated tank search

This commit is contained in:
TrèsAbhi committed 2024-09-17 22:50:34 -05:00
1 parent e241870ece
commit 187230439b
15 files changed
+28 -31

No files matched your search

+3 -1
View File
@@ -1,8 +1,10 @@
import { useRef } from 'react';
import usePromise from 'react-promise-suspense';
/**
* A more stable alternative to `use` using `usePromise`.
*/
export function useAwait<Type>(promise: Promise<Type>) {
return usePromise(async () => await promise, []);
const callback = useRef(async () => await promise);
return usePromise(callback.current, []);
}