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

refactor: safer types #3993

Merged
merged 1 commit into from
Jul 1, 2024
Merged

refactor: safer types #3993

merged 1 commit into from
Jul 1, 2024

Conversation

WofWca
Copy link
Collaborator

@WofWca WofWca commented Jul 1, 2024

To avoid issues like #3990

@WofWca WofWca added the refactor This PR or issue is about refactoring label Jul 1, 2024
@WofWca WofWca force-pushed the wofwca/safer-types-refactor branch 2 times, most recently from fe530e4 to 7ec120d Compare July 1, 2024 11:11
@WofWca WofWca marked this pull request as draft July 1, 2024 11:44
To avoid issues like #3990

This ensures that the type and the array always have the same keys

However, simply adding an extra property on `SettingsValues`
will not cause errors, it will simply keep
the `SettingsStoreState` type unchanged.
But any runtime changes (e.g. adding or accessing a property
without also adding it to the array, or vice versa) will be caught.
@WofWca WofWca force-pushed the wofwca/safer-types-refactor branch from 7ec120d to 22526ae Compare July 1, 2024 12:12
@WofWca WofWca marked this pull request as ready for review July 1, 2024 12:12
@Simon-Laux Simon-Laux merged commit e17e0aa into main Jul 1, 2024
7 checks passed
@Simon-Laux Simon-Laux deleted the wofwca/safer-types-refactor branch July 1, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor This PR or issue is about refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants