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(runtime-core): watching multiple sources: computed #3066

Conversation

Kingbultsea
Copy link
Contributor

@Kingbultsea Kingbultsea commented Jan 20, 2021

fix: #3068

@Kingbultsea
Copy link
Contributor Author

fix: #3068

fix: #3059

@HcySunYang
Copy link
Member

This PR has a flaw, consider the following:

const foo = ref([1])

watch(foo, () => {
  console.log('should trigger')
})

foo.value = foo.value.slice()

with your PR, resulting in not triggering the cb correctly. Here we should check whether the source of observation is really an array.

@LinusBorg LinusBorg added 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: reactivity labels Feb 1, 2021
packages/runtime-core/src/apiWatch.ts Outdated Show resolved Hide resolved
packages/runtime-core/__tests__/apiWatch.spec.ts Outdated Show resolved Hide resolved
packages/runtime-core/src/apiWatch.ts Outdated Show resolved Hide resolved
@LinusBorg
Copy link
Member

@HcySunYang Can you have another look here? seems your requested changes were adressed`

@HcySunYang
Copy link
Member

@LinusBorg I'm not sure if this is really reasonable, even if it works correctly.

@HcySunYang
Copy link
Member

@Kingbultsea Could you please resolve the conflict?

@yyx990803 yyx990803 merged commit e7300eb into vuejs:master May 7, 2021
yangmingshan added a commit to vue-mini/vue-mini that referenced this pull request Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: reactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watch listens to computed and should not be triggered by ref in computed
4 participants