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
|
||||
|
||||
```ts [Signature]
|
||||
function useAsyncData(
|
||||
function useAsyncData<DataT, DataE>(
|
||||
handler: (nuxtApp?: NuxtApp) => Promise<DataT>,
|
||||
options?: AsyncDataOptions<DataT>
|
||||
): AsyncData<DataT>
|
||||
function useAsyncData(
|
||||
): AsyncData<DataT, DataE>
|
||||
function useAsyncData<DataT, DataE>(
|
||||
key: string,
|
||||
handler: (nuxtApp?: NuxtApp) => Promise<DataT>,
|
||||
options?: AsyncDataOptions<DataT>
|
||||
): Promise<AsyncData<DataT>>
|
||||
): Promise<AsyncData<DataT, DataE>
|
||||
|
||||
type AsyncDataOptions<DataT> = {
|
||||
server?: boolean
|
||||
|
Loading…
Reference in New Issue
Block a user