Skip to content

Commit

Permalink
chore: prevent useAsyncResult triggering re-renders
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptotavares committed Dec 20, 2024
1 parent b69558c commit 7b24e67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/hooks/useAsyncResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export function useAsyncResult<T>(
});

useEffect(() => {
setResult({ pending: true });
if (!result.pending) {
setResult({ pending: true });
}
let cancelled = false;
asyncFn()
.then((value) => {
Expand Down

0 comments on commit 7b24e67

Please sign in to comment.