Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
h-h-h-h opened this issue Apr 15, 2022 · 0 comments
Open

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

h-h-h-h opened this issue Apr 15, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@h-h-h-h
Copy link

h-h-h-h commented Apr 15, 2022

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.

@skirtles-code skirtles-code added the enhancement New feature or request label Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants