mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-28 00:22:05 +00:00
refactor: export AsyncDataStrategy
This commit is contained in:
parent
6abab412ad
commit
8e18c1bdc0
@ -31,6 +31,8 @@ export type KeyOfRes<Transform extends _Transform> = KeysOf<ReturnType<Transform
|
||||
|
||||
export type MultiWatchSources = (WatchSource<unknown> | object)[]
|
||||
|
||||
export type AsyncDataStrategy = 'lazy' | 'parallel' | 'blocking'
|
||||
|
||||
export interface AsyncDataOptions<
|
||||
ResT,
|
||||
DataT = ResT,
|
||||
@ -40,7 +42,7 @@ export interface AsyncDataOptions<
|
||||
server?: boolean
|
||||
/** @deprecated Use strategy: 'lazy' */
|
||||
lazy?: boolean
|
||||
strategy?: 'lazy' | 'parallel' | 'blocking'
|
||||
strategy?: AsyncDataStrategy
|
||||
default?: () => DefaultT | Ref<DefaultT>
|
||||
transform?: _Transform<ResT, DataT>
|
||||
pick?: PickKeys
|
||||
|
@ -14,7 +14,7 @@ import type { RenderResponse } from 'nitropack'
|
||||
import type { NuxtIslandContext } from '../core/runtime/nitro/renderer'
|
||||
import type { RouteMiddleware } from '../../app'
|
||||
import type { NuxtError } from '../app/composables/error'
|
||||
import type { AsyncDataOptions, AsyncDataRequestStatus } from '../app/composables/asyncData'
|
||||
import type { AsyncDataRequestStatus, AsyncDataStrategy } from '../app/composables/asyncData'
|
||||
|
||||
const nuxtAppCtx = /* #__PURE__ */ getContext<NuxtApp>('nuxt-app')
|
||||
|
||||
@ -103,7 +103,7 @@ interface _NuxtApp {
|
||||
[key: string]: unknown
|
||||
|
||||
/** @internal */
|
||||
_asyncDataPromises: Record<string, Promise<any> & { strategy?: AsyncDataOptions<any>['strategy'] } | undefined>
|
||||
_asyncDataPromises: Record<string, Promise<any> & { strategy?: AsyncDataStrategy } | undefined>
|
||||
/** @internal */
|
||||
_asyncData: Record<string, {
|
||||
data: Ref<any>
|
||||
|
Loading…
Reference in New Issue
Block a user