-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Labels
🐞 bugSomething isn't workingSomething isn't workinghas PRA pull request has already been submitted to solve the issueA pull request has already been submitted to solve the issuehas workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problem
Description
Version
3.0.0
Reproduction link
https://jsfiddle.net/mravLjd6/4/
Steps to reproduce
Open console and watch output
What is expected?
Only one log message "true false"
What is actually happening?
Log fired every second with "false false"
const { computed, watch, ref } = Vue;
const source = ref(0);
const isZero = computed(() => source.value === 0);
watch(isZero, (prev, next) => console.log(prev, next)); // fires every second
setInterval(() => source.value++, 1000);
This is part from docs(https://v3.vuejs.org/guide/reactivity-computed-watchers.html#watch):
The watch API is the exact equivalent of the component watch property. watch requires watching a specific data source and applies side effects in a separate callback function. It also is lazy by default - i.e. the callback is only called when the watched source has changed.
SeregPie and hinst
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't workinghas PRA pull request has already been submitted to solve the issueA pull request has already been submitted to solve the issuehas workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problem