mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
docs: sync useAsyncData
and useFetch
types (#20935)
This commit is contained in:
parent
4ec2fcb750
commit
da29ac0b7e
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user