Skip to content

Commit

Permalink
fix: reset state when calling useEffect in useAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
hahabazinga authored and streamich committed Dec 29, 2018
1 parent 752e92a commit 2f5af2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/useAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const useAsync = <T>(fn: () => Promise<T>, args?) => {

useEffect(() => {
let mounted = true;
set({
loading: true,
});
const promise = memoized();

promise
Expand Down

0 comments on commit 2f5af2c

Please sign in to comment.