Nuxt/docs/3.api/3.utils/clear-nuxt-data.md

16 lines
538 B
Markdown
Raw Normal View History

# `clearNuxtData`
2023-07-07 16:24:09 +00:00
Delete cached data, error status and pending promises of [`useAsyncData`](/docs/api/composables/use-async-data) and `useFetch`.
This method is useful if you want to invalidate the data fetching for another page.
## Type
```ts
clearNuxtData (keys?: string | string[] | ((key: string) => boolean)): void
```
## Parameters
2023-07-07 16:24:09 +00:00
* `keys`: One or an array of keys that are used in [`useAsyncData`](/docs/api/composables/use-async-data) to delete their cached data. If no keys are provided, **all data** will be invalidated.