From a6af09eba49ea681318074195660a8c086b2f884 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Tue, 16 Jul 2024 23:40:51 +0200 Subject: [PATCH] fix(nuxt): allow `getCachedData` to return undefined (#28187) --- packages/nuxt/src/app/composables/asyncData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index d81b0c1105..097e05f087 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -63,10 +63,10 @@ export interface AsyncDataOptions< default?: () => DefaultT | Ref /** * 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. */ - getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer + getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer | undefined /** * A function that can be used to alter handler function result after resolving. * Do not use it along with the `pick` option.