mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +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
|
immediate?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RefreshOptions {
|
|
||||||
dedupe?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
type AsyncData<DataT, ErrorT> = {
|
type AsyncData<DataT, ErrorT> = {
|
||||||
data: Ref<DataT | null>
|
data: Ref<DataT | null>
|
||||||
pending: Ref<boolean>
|
pending: Ref<boolean>
|
||||||
execute: () => Promise<void>
|
refresh: (opts?: AsyncDataExecuteOptions) => Promise<void>
|
||||||
refresh: (opts?: RefreshOptions) => Promise<void>
|
execute: (opts?: AsyncDataExecuteOptions) => Promise<void>
|
||||||
error: Ref<ErrorT | null>
|
error: Ref<ErrorT | null>
|
||||||
|
};
|
||||||
|
|
||||||
|
interface AsyncDataExecuteOptions {
|
||||||
|
dedupe?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Params
|
## Params
|
||||||
|
@ -29,12 +29,16 @@ type UseFetchOptions = {
|
|||||||
watch?: WatchSource[]
|
watch?: WatchSource[]
|
||||||
}
|
}
|
||||||
|
|
||||||
type AsyncData<DataT> = {
|
type AsyncData<DataT, ErrorT> = {
|
||||||
data: Ref<DataT>
|
data: Ref<DataT | null>
|
||||||
pending: Ref<boolean>
|
pending: Ref<boolean>
|
||||||
refresh: (opts?: { dedupe?: boolean }) => Promise<void>
|
refresh: (opts?: AsyncDataExecuteOptions) => Promise<void>
|
||||||
execute: () => Promise<void>
|
execute: (opts?: AsyncDataExecuteOptions) => Promise<void>
|
||||||
error: Ref<Error | boolean>
|
error: Ref<ErrorT | null>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AsyncDataExecuteOptions {
|
||||||
|
dedupe?: boolean
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user