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

fix: get rid of ++ operator in ref example #2570

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

jacekkarczmarczyk
Copy link
Contributor

@jacekkarczmarczyk jacekkarczmarczyk commented Nov 14, 2023

Description of Problem

Example showing ref's value update uses ++ operator, I think that assigning new value is more common and personally i think that using ++ operator should be avoided in this kind of examples (unless you want to show that you can use this specific operator in some specific cases)

Proposed Solution

- count.value++
+ count.value = 1

Alternative solution

- count.value++
+ count.value = count.value + 1

Additional comments

There could be also example with objects, like

const data = ref(null)

data.value = { name: 'John Doe' }

Let me know if this should be added as well to this PR

@jacekkarczmarczyk jacekkarczmarczyk changed the title fix: ref example fix: get rid of ++ operator in ref example Nov 14, 2023
Copy link

netlify bot commented Nov 14, 2023

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 11275db
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/655363078b9b3800084630f1
😎 Deploy Preview https://deploy-preview-2570--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 configuration.

@NataliaTepluhina NataliaTepluhina merged commit 67f4d3a into vuejs:main Nov 14, 2023
4 checks passed
nazarepiedady pushed a commit to nazarepiedady/vue3-docs that referenced this pull request Nov 30, 2023
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