Add a note about flush: 'sync'
, with links from elsewhere
#1895
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1798 proposed adding information about
flush: 'sync'
to the main guide.In my opinion,
flush: 'sync'
is an escape hatch that should be rarely used and is not something we want to encourage. Such features are typically only mentioned in the API reference, rather than the guide. I think mentioning it in an advanced guide would be fine (e.g. a detailed guide to the scheduler queue), but currently there isn't a suitable advanced guide where this topic can be covered.The existence of
flush: 'sync'
is already mentioned in the API reference, but as far as I'm aware there isn't currently any explanation about what it does.In this PR I've added a paragraph to
watchEffect()
, giving a brief explanation offlush: 'sync'
. I have intentionally not given a lot of information or an example, for the same reason I don't think it should be in the guide.I've also included links to
watchEffect()
in the entries forwatch
,$watch()
andwatch()
, under theflush
option. The alternative was to duplicate the explanation 4 times, which I didn't want to do.