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

Give a better example of val use cases #4634

Closed
wants to merge 1 commit into from

Conversation

GarethFlandro
Copy link

The existing variables and descriptions were things that would be updated as soon as the next customer came, whereas the price would likely remain the same.

The existing variables and descriptions were things that would be updated as soon as the next customer came, whereas the price would likely remain the same.
@GarethFlandro GarethFlandro requested a review from a team as a code owner January 6, 2025 17:08
@sarahhaggarty sarahhaggarty self-assigned this Jan 7, 2025
@sarahhaggarty
Copy link
Collaborator

Hi @GarethFlandro
Thanks for your suggestion! I discussed it with our developer advocates and after some thought we decided to leave the code as-is. The price itself can also change. The purpose of the example is to demonstrate what we recommend in the note: that by default, variables should be declared as read-only and made mutable only if necessary.
I'll close the PR now but thanks for sharing your thoughts with us!

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