Skip to content

Commit

Permalink
feat(computedAsync)!: set shallow defalut to true (#2621)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
xiankq and antfu committed Mar 4, 2023
1 parent d8d732e commit 23c9d45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions packages/core/computedAsync/index.md
Expand Up @@ -83,5 +83,3 @@ const userInfo = computedAsync(
- Just like Vue's built-in `computed` function, `computedAsync` does dependency tracking and is automatically re-evaluated when dependencies change. Note however that only dependency referenced in the first call stack are considered for this. In other words: **Dependencies that are accessed asynchronously will not trigger re-evaluation of the async computed value.**

- As opposed to Vue's built-in `computed` function, re-evaluation of the async computed value is triggered whenever dependencies are changing, regardless of whether its result is currently being tracked or not.

- The default value of the `shallow` will be changed to `true` in the next major version.
6 changes: 2 additions & 4 deletions packages/core/computedAsync/index.ts
Expand Up @@ -26,9 +26,7 @@ export interface AsyncComputedOptions {
/**
* Use shallowRef
*
* The default value will be changed to `true` in the next major version
*
* @default false
* @default true
*/
shallow?: boolean

Expand Down Expand Up @@ -65,7 +63,7 @@ export function computedAsync<T>(
const {
lazy = false,
evaluating = undefined,
shallow = false,
shallow = true,
onError = noop,
} = options

Expand Down

0 comments on commit 23c9d45

Please sign in to comment.