From 661dacdc285b3605af006456c7c078cd366e9ab8 Mon Sep 17 00:00:00 2001 From: okxiaoliang4 <353742991@qq.com> Date: Sun, 10 Jul 2022 13:10:11 +0800 Subject: [PATCH] fix(useAsyncState)!: rename type AsyncStateOptions to UseAsyncStateOptions --- packages/core/useAsyncState/index.ts | 4 ++-- packages/core/useImage/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/useAsyncState/index.ts b/packages/core/useAsyncState/index.ts index 969715e619a..57699307414 100644 --- a/packages/core/useAsyncState/index.ts +++ b/packages/core/useAsyncState/index.ts @@ -10,7 +10,7 @@ export interface UseAsyncStateReturn { execute: (delay?: number, ...args: any[]) => Promise } -export interface AsyncStateOptions { +export interface UseAsyncStateOptions { /** * Delay for executing the promise. In milliseconds. * @@ -64,7 +64,7 @@ export interface AsyncStateOptions { export function useAsyncState( promise: Promise | ((...args: any[]) => Promise), initialState: Data, - options?: AsyncStateOptions, + options?: UseAsyncStateOptions, ): UseAsyncStateReturn { const { immediate = true, diff --git a/packages/core/useImage/index.ts b/packages/core/useImage/index.ts index 39124223c0b..323a17697cd 100644 --- a/packages/core/useImage/index.ts +++ b/packages/core/useImage/index.ts @@ -1,7 +1,7 @@ import { watch } from 'vue-demi' import type { MaybeComputedRef } from '@vueuse/shared' import { resolveUnref } from '@vueuse/shared' -import type { AsyncStateOptions } from '../useAsyncState' +import type { UseAsyncStateOptions } from '../useAsyncState' import { useAsyncState } from '../useAsyncState' export interface UseImageOptions { @@ -38,7 +38,7 @@ async function loadImage(options: UseImageOptions): Promise { */ export const useImage = ( options: MaybeComputedRef, - asyncStateOptions: AsyncStateOptions = {}, + asyncStateOptions: UseAsyncStateOptions = {}, ) => { const state = useAsyncState( () => loadImage(resolveUnref(options)),