Skip to content

Commit

Permalink
fix(useAsyncState)!: rename type AsyncStateOptions to `UseAsyncStat…
Browse files Browse the repository at this point in the history
…eOptions` (#1809)
  • Loading branch information
okxiaoliang4 committed Jul 10, 2022
1 parent c78bb8e commit 24edeaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/useAsyncState/index.ts
Expand Up @@ -10,7 +10,7 @@ export interface UseAsyncStateReturn<Data, Shallow extends boolean> {
execute: (delay?: number, ...args: any[]) => Promise<Data>
}

export interface AsyncStateOptions<Shallow extends boolean> {
export interface UseAsyncStateOptions<Shallow extends boolean> {
/**
* Delay for executing the promise. In milliseconds.
*
Expand Down Expand Up @@ -64,7 +64,7 @@ export interface AsyncStateOptions<Shallow extends boolean> {
export function useAsyncState<Data, Shallow extends boolean = true>(
promise: Promise<Data> | ((...args: any[]) => Promise<Data>),
initialState: Data,
options?: AsyncStateOptions<Shallow>,
options?: UseAsyncStateOptions<Shallow>,
): UseAsyncStateReturn<Data, Shallow> {
const {
immediate = true,
Expand Down
4 changes: 2 additions & 2 deletions 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 {
Expand Down Expand Up @@ -38,7 +38,7 @@ async function loadImage(options: UseImageOptions): Promise<HTMLImageElement> {
*/
export const useImage = <Shallow extends true>(
options: MaybeComputedRef<UseImageOptions>,
asyncStateOptions: AsyncStateOptions<Shallow> = {},
asyncStateOptions: UseAsyncStateOptions<Shallow> = {},
) => {
const state = useAsyncState<HTMLImageElement | undefined>(
() => loadImage(resolveUnref(options)),
Expand Down

0 comments on commit 24edeaa

Please sign in to comment.