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

adjust beacon model to make beaconInfo definitely assigned in constructor #3201

Merged
merged 4 commits into from
Mar 9, 2023

Conversation

kerryarchibald
Copy link
Contributor

@kerryarchibald kerryarchibald commented Mar 9, 2023

To aid in strictNullChecks work in react-sdk, remove unnecessary optional operator on _beaconInfo

element-hq/element-web#24756

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

looks great

Comment on lines 59 to 60
// setBeaconInfo also assigns this._beaconInfo
// manually assign here to make tsc believe it is definitely assigned in constructor
Copy link
Member

Choose a reason for hiding this comment

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

loving this comment, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

You can also use private _beaconInfo!: BeaconInfoState; instead

@kerryarchibald kerryarchibald added this pull request to the merge queue Mar 9, 2023
Merged via the queue into develop with commit 9b1f2a1 Mar 9, 2023
@kerryarchibald kerryarchibald deleted the kerry/beaconInfo branch March 9, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants