docs icon indicating copy to clipboard operation
docs copied to clipboard

Add a note about `flush: 'sync'`, with links from elsewhere

Open skirtles-code opened this issue 3 years ago • 1 comments

#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 of flush: '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 for watch, $watch() and watch(), under the flush option. The alternative was to duplicate the explanation 4 times, which I didn't want to do.

skirtles-code avatar Aug 08 '22 09:08 skirtles-code

Deploy Preview for vuejs ready!

Name Link
Latest commit 6a5fc04ea467f6a90cd1f00689bcd14596f83719
Latest deploy log https://app.netlify.com/sites/vuejs/deploys/62f0de448adeb90008994361
Deploy Preview https://deploy-preview-1895--vuejs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Aug 08 '22 09:08 netlify[bot]