Skip to content

Update: watchers.md #2069

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 3 commits into from
Closed

Update: watchers.md #2069

wants to merge 3 commits into from

Conversation

JohnnyEvo
Copy link
Contributor

Add Eager Watchers section to composition side

Description of Problem

When we are in composition option, Eager watchers is not mentioned.

Proposed Solution

Add Eager watchers in composition option.

Additional Information

Add `Eager Watchers` section to composition side
@netlify
Copy link

netlify bot commented Nov 8, 2022

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 2a4e15a
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/636cbde33caae000082db6e3
😎 Deploy Preview https://deploy-preview-2069--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.

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, this does need to be covered.

I've provided some feedback on your proposed changes below.

@JohnnyEvo
Copy link
Contributor Author

Thank you, I considered your review

@skirtles-code
Copy link
Contributor

@JohnnyEvo Thanks for making those changes.

I've just had another read through and I think we now have a problem with the section about watchEffect(). The wording of that section no longer makes sense now that it's preceded by this new section about immediate: true.

Would you like to attempt that rewording yourself? If not then I can give it a go.

@JohnnyEvo
Copy link
Contributor Author

@skirtles-code I'm not sure I understand what is problematic. Here's my proposal, I'll let you rework it if that doesn't work.

Thanks

@skirtles-code
Copy link
Contributor

The problem is that the watchEffect() section presents watchEffect() as a way to implement eager watchers. It starts with a sentence saying that watch() is lazy and then shows how watchEffect() is the solution to that problem. It doesn't make sense if it comes immediately after a section all about eager watchers. We're presenting two solutions to the same problem without acknowledging the overlap.

With hindsight I don't think the omission of the section about eager watcher is an oversight. I think it was intentional, with the section about watchEffect() being seen as a way to solve the same problem. I still think having a section about eager watchers is a good idea, but we can't have the watchEffect() section framed as a solution to a problem we've just solved in the preceding section.

@JohnnyEvo
Copy link
Contributor Author

I understand the inconsistency.
We can say that there is an alternative for the lazy watch... but what is the point of having two different ways of doing the same thing? Why choose one or the other?

@skirtles-code
Copy link
Contributor

I've pulled these commits into #2144 and made some changes to the watchEffect() section, so that it doesn't seem quite so out of place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants