Skip to content

Commit

Permalink
docs: explain useasyncdata wrapping (#2054)
Browse files Browse the repository at this point in the history
  • Loading branch information
clemcode committed May 4, 2023
1 parent a12fc4a commit 9e89b65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/3.guide/2.displaying/2.querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ queryContent('/').find()
queryContent('/').findOne()
```

### With `useAsyncData`
### Wrap your query with `useAsyncData`

Wrap your query in the [`useAsyncData` composable](https://v3.nuxtjs.org/api/composables/use-async-data) (auto-imported as well).
To prevent fetching duplication on first load, wrap your query in the [`useAsyncData` composable](https://v3.nuxtjs.org/api/composables/use-async-data) (auto-imported as well).

```js
const { data } = await useAsyncData('home', () => queryContent('/').findOne())
Expand Down

0 comments on commit 9e89b65

Please sign in to comment.