Skip to content

watchEffect doesn't trigger when it should #9773

Discussion options

You must be logged in to vote

Yeah sure. That example is in fact showing the point I wanted to explain previously.

There's two aspects you are missing about how reactive dependency tracking works:

  1. reactive dependencies are tracked by observing property reads. If there's a reactive object or a ref in the code of an effect, but its not being read from during the effect's run, no dependency will be tracked.
  2. reactive dependencies are re-collected on each run of an effect. This is so that a) new dependencies, that might not have been accessed/read from in a previous run, can be read, and b) old dependencies, that are no longer being read from in the latest run, can be discarded.

In your example:

  1. once isExternalValue is f…

Replies: 2 comments 13 replies

Comment options

You must be logged in to vote
12 replies
@LinusBorg
Comment options

@fabruex
Comment options

@LinusBorg
Comment options

@fabruex
Comment options

@fabruex
Comment options

Comment options

You must be logged in to vote
1 reply
@fabruex
Comment options

Answer selected by fabruex
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
3 participants