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

docs: 🐛 Fixed all code examples (missing '), Rewrote upgrading Ob… #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cycle4passion
Copy link

Thanks for another great tool.

@CaptainCodeman
Copy link
Owner

CaptainCodeman commented Nov 20, 2023

Thanks for the PR

The only thing I would change is the "object upgrading" example. I don't think anyone should be adding an arbitrary property like this (the $settings.theme = 'system'; part), instead the idea was that it will save you having to manually add a property (which would normally have to include a check if it was undefined) and keep the default definitions together without any repetition, and the typing of settings (for this example) intact.

i.e. you just need to define the new initial default value and even if someone has already saved a version without it, it will be added, with no need for you to handle versions that didn't have it, so settings.theme would be set to 'system' without you having to do anything, regardless of whether it was previously persisted or not (most of the other libs end up returning undefined in this case)

Hope that makes sense :)

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