Skip to content

Clean up makeGraph.makeGetter #1167

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

Conversation

pokey
Copy link
Member

@pokey pokey commented Dec 9, 2022

Checklist

@pokey pokey mentioned this pull request Dec 9, 2022
1 task
Comment on lines +15 to +17
const componentValue = components[key];
if (componentValue != null) {
return componentValue;
Copy link
Member

Choose a reason for hiding this comment

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

If TypeScript is updated we should be able to still check components[key] without an intermediate const: https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#control-flow-analysis-for-element-access

Suggested change
const componentValue = components[key];
if (componentValue != null) {
return componentValue;
if (components[key] != null) {
return components[key];

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice. Fwiw I'll prob just close this PR tho. I factored it out of another PR, but we're moving to pure DI, so this code is all going to go away

@pokey
Copy link
Member Author

pokey commented Dec 10, 2022

Closing, as we're moving to pure DI

@pokey pokey closed this Dec 10, 2022
@pokey pokey deleted the pokey/clean-up-makegraphmakegetter branch February 16, 2023 15:26
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