WhoReacted: Make more reliable & don't spam api

This commit is contained in:
Vendicated 2022-11-25 18:07:29 +01:00
parent bb398970ef
commit b60f6cb18d
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
6 changed files with 104 additions and 13 deletions

View file

@ -70,6 +70,11 @@ export function useAwaiter<T>(factory: () => Promise<T>, fallbackValue: T | null
return [state.value, state.error, state.pending, () => setSignal(signal + 1)];
}
export function useForceUpdater() {
const [, set] = React.useState(0);
return () => set(s => s + 1);
}
/**
* A lazy component. The factory method is called on first render. For example useful
* for const Component = LazyComponent(() => findByDisplayName("...").default)