fix: reset state when calling useEffect in useAsync

This commit is contained in:
hahabazinga 2018-12-29 23:26:15 +08:00 committed by Va Da
parent 752e92a0f2
commit 2f5af2ca66

View File

@ -25,6 +25,9 @@ const useAsync = <T>(fn: () => Promise<T>, args?) => {
useEffect(() => {
let mounted = true;
set({
loading: true,
});
const promise = memoized();
promise