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

docs: sync useAsyncData and useFetch types #20935

Merged
merged 1 commit into from May 18, 2023
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
14 changes: 6 additions & 8 deletions docs/3.api/1.composables/use-async-data.md
Expand Up @@ -28,19 +28,17 @@ type AsyncDataOptions<DataT> = {
immediate?: boolean
}

interface RefreshOptions {
dedupe?: boolean
}

type AsyncData<DataT, ErrorT> = {
data: Ref<DataT | null>
pending: Ref<boolean>
execute: () => Promise<void>
refresh: (opts?: RefreshOptions) => Promise<void>
refresh: (opts?: AsyncDataExecuteOptions) => Promise<void>
execute: (opts?: AsyncDataExecuteOptions) => Promise<void>
error: Ref<ErrorT | null>
}

};

interface AsyncDataExecuteOptions {
dedupe?: boolean
}
```

## Params
Expand Down
14 changes: 9 additions & 5 deletions docs/3.api/1.composables/use-fetch.md
Expand Up @@ -29,12 +29,16 @@ type UseFetchOptions = {
watch?: WatchSource[]
}

type AsyncData<DataT> = {
data: Ref<DataT>
type AsyncData<DataT, ErrorT> = {
data: Ref<DataT | null>
pending: Ref<boolean>
refresh: (opts?: { dedupe?: boolean }) => Promise<void>
execute: () => Promise<void>
error: Ref<Error | boolean>
refresh: (opts?: AsyncDataExecuteOptions) => Promise<void>
execute: (opts?: AsyncDataExecuteOptions) => Promise<void>
error: Ref<ErrorT | null>
}

interface AsyncDataExecuteOptions {
dedupe?: boolean
}
```

Expand Down