Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): call data refresh hook in parallel (#8470)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 25, 2022
1 parent 91eab1b commit 1d795f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/composables/asyncData.ts
Expand Up @@ -264,12 +264,12 @@ export function useLazyAsyncData<
return useAsyncData(key, handler, { ...options, lazy: true }, null)
}

export function refreshNuxtData (keys?: string | string[]): Promise<void> {
export async function refreshNuxtData (keys?: string | string[]): Promise<void> {
if (process.server) {
return Promise.resolve()
}
const _keys = keys ? Array.isArray(keys) ? keys : [keys] : undefined
return useNuxtApp().callHook('app:data:refresh', _keys)
await useNuxtApp().hooks.callHookParallel('app:data:refresh', _keys)
}

export function clearNuxtData (keys?: string | string[] | ((key: string) => boolean)): void {
Expand Down

0 comments on commit 1d795f0

Please sign in to comment.