Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useAsyncState)!: rename type AsyncStateOptions to UseAsyncStateOptions #1809

Merged
merged 1 commit into from Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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