mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
docs: add additional type generics to useAsyncData
(#22760)
This commit is contained in:
parent
16a200a65a
commit
e058a10525
@ -12,15 +12,15 @@ Within your pages, components, and plugins you can use useAsyncData to get acces
|
|||||||
## Type
|
## Type
|
||||||
|
|
||||||
```ts [Signature]
|
```ts [Signature]
|
||||||
function useAsyncData(
|
function useAsyncData<DataT, DataE>(
|
||||||
handler: (nuxtApp?: NuxtApp) => Promise<DataT>,
|
handler: (nuxtApp?: NuxtApp) => Promise<DataT>,
|
||||||
options?: AsyncDataOptions<DataT>
|
options?: AsyncDataOptions<DataT>
|
||||||
): AsyncData<DataT>
|
): AsyncData<DataT, DataE>
|
||||||
function useAsyncData(
|
function useAsyncData<DataT, DataE>(
|
||||||
key: string,
|
key: string,
|
||||||
handler: (nuxtApp?: NuxtApp) => Promise<DataT>,
|
handler: (nuxtApp?: NuxtApp) => Promise<DataT>,
|
||||||
options?: AsyncDataOptions<DataT>
|
options?: AsyncDataOptions<DataT>
|
||||||
): Promise<AsyncData<DataT>>
|
): Promise<AsyncData<DataT, DataE>
|
||||||
|
|
||||||
type AsyncDataOptions<DataT> = {
|
type AsyncDataOptions<DataT> = {
|
||||||
server?: boolean
|
server?: boolean
|
||||||
|
Loading…
Reference in New Issue
Block a user