Skip to content

Commit edb058a

Browse files
atinuxKamsou
authored andcommitted
docs: update deep default for useAsyncData & useFetch (nuxt#28564)
1 parent 3687b27 commit edb058a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/3.api/2.composables/use-async-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const { data: posts } = await useAsyncData(
7272
- `getCachedData`: Provide a function which returns cached data. A _null_ or _undefined_ return value will trigger a fetch. By default, this is: `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]`, which only caches data when `payloadExtraction` is enabled.
7373
- `pick`: only pick specified keys in this array from the `handler` function result
7474
- `watch`: watch reactive sources to auto-refresh
75-
- `deep`: return data in a deep ref object (it is `true` by default). It can be set to `false` to return data in a shallow ref object, which can improve performance if your data does not need to be deeply reactive.
75+
- `deep`: return data in a deep ref object. It is `false` by default to return data in a shallow ref object for performance.
7676
- `dedupe`: avoid fetching same key more than once at a time (defaults to `cancel`). Possible options:
7777
- `cancel` - cancels existing requests when a new one is made
7878
- `defer` - does not make new requests at all if there is a pending request

docs/3.api/2.composables/use-fetch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ All fetch options can be given a `computed` or `ref` value. These will be watche
108108
- `getCachedData`: Provide a function which returns cached data. A _null_ or _undefined_ return value will trigger a fetch. By default, this is: `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]`, which only caches data when `payloadExtraction` is enabled.
109109
- `pick`: only pick specified keys in this array from the `handler` function result
110110
- `watch`: watch an array of reactive sources and auto-refresh the fetch result when they change. Fetch options and URL are watched by default. You can completely ignore reactive sources by using `watch: false`. Together with `immediate: false`, this allows for a fully-manual `useFetch`. (You can [see an example here](/docs/getting-started/data-fetching#watch) of using `watch`.)
111-
- `deep`: return data in a deep ref object (it is `true` by default). It can be set to `false` to return data in a shallow ref object, which can improve performance if your data does not need to be deeply reactive.
111+
- `deep`: return data in a deep ref object. It is `false` by default to return data in a shallow ref object for performance.
112112
- `dedupe`: avoid fetching same key more than once at a time (defaults to `cancel`). Possible options:
113113
- `cancel` - cancels existing requests when a new one is made
114114
- `defer` - does not make new requests at all if there is a pending request

packages/nuxt/src/app/composables/asyncData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface AsyncDataOptions<
8484
*/
8585
immediate?: boolean
8686
/**
87-
* Return data in a deep ref object (it is true by default). It can be set to false to return data in a shallow ref object, which can improve performance if your data does not need to be deeply reactive.
87+
* Return data in a deep ref object (it is false by default). It can be set to false to return data in a shallow ref object, which can improve performance if your data does not need to be deeply reactive.
8888
*/
8989
deep?: boolean
9090
/**

0 commit comments

Comments
 (0)