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

Prevent useStorage from immediately saving the default value #497

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

pleek91
Copy link
Collaborator

@pleek91 pleek91 commented Oct 15, 2024

Description

The watchEffect runs immediately which caused the default value to get set into storage. Which means even if the value isn't actually set by the user, its already in storage which can pollute storage (which has a limited size).

Using a watch will only update storage when the value is changed by the user.

@pleek91 pleek91 requested a review from a team as a code owner October 15, 2024 01:43
Copy link
Contributor

@znicholasbrown znicholasbrown left a comment

Choose a reason for hiding this comment

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

Nice

@pleek91 pleek91 merged commit a639b96 into main Oct 15, 2024
3 checks passed
@pleek91 pleek91 deleted the storage-stop-immediate-set branch October 15, 2024 14:07
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