Skip to content

Add: Callback Flush Timing - About the flush: sync #1798

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

Closed
wants to merge 1 commit into from
Closed

Add: Callback Flush Timing - About the flush: sync #1798

wants to merge 1 commit into from

Conversation

niceplugin
Copy link

Add content that watchers.md : Callback Flush Timing - About the flush: sync option

Among the options used for watch, flush: 'sync' was not explained in the guide or API documentation, so I added it.

It need to check because my English is not good.

Hope this helps.

Add content that watchers.md : Callback Flush Timing - About the flush: sync option

Among the options used for watch, `flush: 'sync'` was not explained in the guide or API documentation, so I added it.

It need to check because my English is not good.

Hope this helps.
@netlify
Copy link

netlify bot commented Jun 25, 2022

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit e8ec147
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/62b6915793baba000849674e
😎 Deploy Preview https://deploy-preview-1798--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.

@skirtles-code skirtles-code added the state: review PR issued and under review label Jun 26, 2022
@niceplugin
Copy link
Author

It looks fine, but I only got the review label.
Is there anything more I should do?

@skirtles-code
Copy link
Contributor

Thanks for the PR and sorry for the delay in getting back to you.

flush: 'sync' poses a documentation challenge. It's an 'escape hatch' feature, intended to be used in specific edge cases by advanced users. Such features are typically not covered in the main guides, or at least not the guides aimed at beginners. Usually such features are only documented in the API reference, or even omitted from the docs entirely in extreme cases. In this specific case we have the added complication that flush: 'pre' and flush: 'post' are mainstream, commonly used features that very much need to be covered in the basic guides.

I did raise this internally and the feeling seemed to be that we want to keep 'sync' out of the main guide. It's already mentioned in the API reference, but as you correctly pointed out there's no explanation about what it does.

Adding an explanation in the API reference is also a bit of a pain because the flush setting is relevant to various entries.

I've tried to strike a balance in #1895 (now merged), providing a brief introduction to flush: 'sync' and also trying to warn people away from using it. The explanation is under watchEffect, with links added from other places that have a flush setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: review PR issued and under review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants