mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: migrated tank search
This commit is contained in:
1 parent
e241870ece
commit
187230439b
15 files changed
+28
-31
No files matched your search
@@ -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, []);
|
||||
}
|
||||
Reference in new issue
Block a user