From ada7aca6a07de08fb3948a99f7b63cece4fb2004 Mon Sep 17 00:00:00 2001 From: webfansplz <308241863@qq.com> Date: Mon, 23 Aug 2021 21:07:41 +0800 Subject: [PATCH] fix(useAsyncState): onError param type (#692) Co-authored-by: webfansplz <> --- packages/core/useAsyncState/index.md | 2 +- packages/core/useAsyncState/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/useAsyncState/index.md b/packages/core/useAsyncState/index.md index 63f7ec4b5e6b..c95e02999977 100644 --- a/packages/core/useAsyncState/index.md +++ b/packages/core/useAsyncState/index.md @@ -44,7 +44,7 @@ export interface AsyncStateOptions { /** * Callback when error is caught. */ - onError?: (e: Error) => void + onError?: (e: unknown) => void /** * Sets the state to initialState before executing the promise. * diff --git a/packages/core/useAsyncState/index.ts b/packages/core/useAsyncState/index.ts index 0028b0bab9ab..13a99051cc62 100644 --- a/packages/core/useAsyncState/index.ts +++ b/packages/core/useAsyncState/index.ts @@ -22,7 +22,7 @@ export interface AsyncStateOptions { /** * Callback when error is caught. */ - onError?: (e: Error) => void + onError?: (e: unknown) => void /** * Sets the state to initialState before executing the promise. @@ -59,7 +59,7 @@ export function useAsyncState( const state = shallowRef(initialState) const isReady = ref(false) - const error = ref(undefined) + const error = ref(undefined) async function execute(delay = 0) { if (resetOnExecute)