mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
fix(nuxt): allow getCachedData
to return undefined (#28187)
This commit is contained in:
parent
6abaae7fa1
commit
a6af09eba4
@ -63,10 +63,10 @@ export interface AsyncDataOptions<
|
|||||||
default?: () => DefaultT | Ref<DefaultT>
|
default?: () => DefaultT | Ref<DefaultT>
|
||||||
/**
|
/**
|
||||||
* Provide a function which returns cached data.
|
* Provide a function which returns cached data.
|
||||||
* A `null` or `undefined` return value will trigger a fetch.
|
* An `undefined` return value will trigger a fetch.
|
||||||
* Default is `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]` which only caches data when payloadExtraction is enabled.
|
* Default is `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]` which only caches data when payloadExtraction is enabled.
|
||||||
*/
|
*/
|
||||||
getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer<DataT>
|
getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer<DataT> | undefined
|
||||||
/**
|
/**
|
||||||
* A function that can be used to alter handler function result after resolving.
|
* A function that can be used to alter handler function result after resolving.
|
||||||
* Do not use it along with the `pick` option.
|
* Do not use it along with the `pick` option.
|
||||||
|
Loading…
Reference in New Issue
Block a user