-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Description
Version
3.0.4
Reproduction link
Steps to reproduce
I've provided two examples but I believe they're both effectively the same problem. In both cases you just need to click the button and then check the logging.
Notice that the logging from the watch
gets behind. The new value isn't logged until the following button click.
The first example uses ref
attributes to update a reactive ref
. The second example uses an updated
hook to achieve a similar effect.
The workaround in both cases is to set flush: 'post'
. However, that shouldn't be necessary. Any watchers with flush: 'pre'
that are still in the queue at the end of rendering should be processed immediately. I haven't checked the code but it may just be a case of going through another rendering cycle when there are outstanding watchers rather than specifically flushing the pre-watchers.
What is expected?
All remaining watchers should be called by the time the rendering loop completes.
What is actually happening?
The watcher isn't called until the next time rendering is triggered.