diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-25 18:07:29 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-25 18:07:29 +0100 |
commit | b60f6cb18d1d55d367ae2f3c322d76b709eacdfe (patch) | |
tree | c2d06ff7643da8244c157c03e877b273b5b61a39 /src/utils/misc.tsx | |
parent | bb398970ef7d60c68191f5e6e153bdba24e07207 (diff) | |
download | Vencord-b60f6cb18d1d55d367ae2f3c322d76b709eacdfe.tar.gz Vencord-b60f6cb18d1d55d367ae2f3c322d76b709eacdfe.tar.bz2 Vencord-b60f6cb18d1d55d367ae2f3c322d76b709eacdfe.zip |
WhoReacted: Make more reliable & don't spam api
Diffstat (limited to 'src/utils/misc.tsx')
-rw-r--r-- | src/utils/misc.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx index 005bcc0..44fc819 100644 --- a/src/utils/misc.tsx +++ b/src/utils/misc.tsx @@ -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) |