Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(watch): allow to pass {deep: true} on ref primitives #984

Merged
merged 3 commits into from
Apr 17, 2020

Conversation

pikax
Copy link
Member

@pikax pikax commented Apr 17, 2020

if you pass {deep:true} and you are watching a primitive ref it will always be undefined

    const count = ref(0)
    let dummy
    watch(
      count,
      (c, prevCount) => {
        dummy = [c, prevCount]
      },
      {
        deep: true
      }
    )

packages/runtime-core/src/apiWatch.ts Outdated Show resolved Hide resolved
@yyx990803 yyx990803 merged commit 99fd158 into vuejs:master Apr 17, 2020
yangmingshan added a commit to vue-mini/vue-mini that referenced this pull request Apr 23, 2020
pikax added a commit to pikax/vue-next that referenced this pull request Apr 29, 2020
@pikax pikax deleted the fix/watch-deep-primitive-fix branch May 6, 2020 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants