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

Make Context.state type to {} by default #1284

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

LoicPoullain
Copy link
Member

Issue

When using Context.state, if we forget to provide a value for the generic type, the property works as if it was of type any which is not type-safe.

Solution and steps

  • Make Context.state default type to "{}" to make it necessary to provide a value for the generic type.

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

@LoicPoullain LoicPoullain changed the title Make Context.state type to "{}" by default Make Context.state type to {} by default Aug 22, 2024
@LoicPoullain LoicPoullain mentioned this pull request Aug 22, 2024
14 tasks
@LoicPoullain LoicPoullain merged commit ccabf9f into v5-0-0 Aug 22, 2024
2 checks passed
@LoicPoullain LoicPoullain deleted the context-unkwon branch August 22, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done / Closed This Release
Development

Successfully merging this pull request may close these issues.

1 participant