From 24edeaa8edf5b37fc58e687401205c5a5768930c Mon Sep 17 00:00:00 2001 From: Jelf <353742991@qq.com> Date: Sun, 10 Jul 2022 13:22:29 +0800 Subject: [PATCH] fix(useAsyncState)!: rename type `AsyncStateOptions` to `UseAsyncStateOptions` (#1809) --- 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)),