mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
fix(nuxt3): use inferred type for useFetch
(#4058)
This commit is contained in:
parent
6577602894
commit
9f6eff7511
@ -165,8 +165,7 @@ export function useAsyncData<
|
||||
const asyncDataPromise = Promise.resolve(nuxt._asyncDataPromises[key]).then(() => asyncData) as AsyncData<DataT>
|
||||
Object.assign(asyncDataPromise, asyncData)
|
||||
|
||||
// @ts-ignore
|
||||
return asyncDataPromise as AsyncData<DataT>
|
||||
return asyncDataPromise as AsyncData<PickFrom<ReturnType<Transform>, PickKeys>>
|
||||
}
|
||||
|
||||
export function useLazyAsyncData<
|
||||
|
@ -42,7 +42,7 @@ export function useFetch<
|
||||
cache: typeof opts.cache === 'boolean' ? undefined : opts.cache
|
||||
}
|
||||
|
||||
const _asyncDataOptions: AsyncDataOptions<any> = {
|
||||
const _asyncDataOptions: AsyncDataOptions<_ResT, Transform, PickKeys> = {
|
||||
...opts,
|
||||
watch: [
|
||||
_request,
|
||||
|
Loading…
Reference in New Issue
Block a user