diff --git a/packages/lib/src/hooks/useAsync.ts b/packages/lib/src/hooks/useAsync.ts index 5ce3d289..03092192 100644 --- a/packages/lib/src/hooks/useAsync.ts +++ b/packages/lib/src/hooks/useAsync.ts @@ -17,7 +17,6 @@ export function useAsync( data: null as T | null, error: null as any | null, loading: true as boolean, - promise: undefined as Promise | undefined, }, ({ hook, oldHook, update }) => { if (depsRequireChange(deps, oldHook?.deps)) { @@ -25,8 +24,7 @@ export function useAsync( hook.loading = true hook.error = null hook.deps = deps - hook.promise = func() - hook.promise + func() .then((data: T) => { if (!depsRequireChange(deps, hook.deps)) { hook.data = data