Skip to content

Commit

Permalink
perf: remove asyn/await wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 21, 2019
1 parent 46d0c27 commit 8e3de1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useAsyncRetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useAsync from './useAsync';

const useAsyncRetry = <T>(fn: () => Promise<T>, args: any[] = []) => {
const [attempt, setAttempt] = useState<number>(0);
const memoized = useCallback(async () => await fn(), [...args, attempt]);
const memoized = useCallback(() => fn(), [...args, attempt]);
const state = useAsync(memoized);

const retry = useCallback(() => {
Expand Down

0 comments on commit 8e3de1c

Please sign in to comment.