Skip to content

watch() flush option values "pre"/"post"/"sync" not defined #1668

@h-h-h-h

Description

@h-h-h-h

Unfortunately, the docs miss exhaustive descriptions of these options on the following pages:

Strangely, I found more exhaustive Vue 3-related documentation here on w3cub.com that explains the flush option in detail. How does a third-party website have more documentation than the official website of the product? 😶 Where does it even come from?


I want to use { flush: "pre" } to watch multiple sources as a whole, sources that are often, but not always, mutated together and where a watcher-callback-run after the mutation of just one source might catch an inconsistent state, which leads to undefined behavior. (Related bug just fixed.)

It would be good if the AND/OR behavior of watch() on multiple sources was also clarified for each flush option value. I guess "sync" can be described as linking with OR; "pre" and "post" as linking with AND in the context of one update tick.

According to w3cub.com, "pre" "specifies that the callback should be invoked before rendering." Could it be further clarified what that means in a context like the following? There are multiple composables, each watch()ing its inputs and generating/mutating reactive outputs in the callback that are the inputs of the next composable, until finally a component is fed by the last composable's outputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions