Skip to content

Commit

Permalink
fix(useAsyncState): onError param type (vitest-dev#692)
Browse files Browse the repository at this point in the history
Co-authored-by: webfansplz <>
  • Loading branch information
webfansplz committed Aug 23, 2021
1 parent b465d89 commit ada7aca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/useAsyncState/index.md
Expand Up @@ -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.
*
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useAsyncState/index.ts
Expand Up @@ -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.
Expand Down Expand Up @@ -59,7 +59,7 @@ export function useAsyncState<T>(

const state = shallowRef(initialState)
const isReady = ref(false)
const error = ref<Error | undefined>(undefined)
const error = ref<unknown | undefined>(undefined)

async function execute(delay = 0) {
if (resetOnExecute)
Expand Down

0 comments on commit ada7aca

Please sign in to comment.