2023-10-18 10:59:43 +00:00
---
title: 'clearNuxtData'
description: Delete cached data, error status and pending promises of useAsyncData and useFetch.
links:
- label: Source
icon: i-simple-icons-github
to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/asyncData.ts
size: xs
---
2022-09-07 11:20:09 +00:00
2024-02-21 17:09:45 +00:00
::note
2022-09-07 11:20:09 +00:00
This method is useful if you want to invalidate the data fetching for another page.
2023-10-18 10:59:43 +00:00
::
2022-09-07 11:20:09 +00:00
## Type
```ts
2022-09-07 13:25:37 +00:00
clearNuxtData (keys?: string | string[] | ((key: string) => boolean)): void
2022-09-07 11:20:09 +00:00
```
## 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.