Skip to content

Conversation

@sirreal
Copy link
Member

@sirreal sirreal commented Dec 12, 2019

Description

Part of #18838
Extracted from #18942

Add types to dom-ready package.

Testing Instructions:

Verify type checking passes:

npm run lint-types

Copy link
Member Author

Choose a reason for hiding this comment

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

Subtle behavioral change - this function did not always return void as its type suggested. In this branch, tt would return whatever the callback returned.

Adding the void here so the function always returns undefined.

Copy link
Member

Choose a reason for hiding this comment

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

Subtle behavioral change - this function did not always return void as its type suggested. In this branch, tt would return whatever the callback returned.

Adding the void here so the function always returns undefined.

I think this syntax can be a little unexpected for some people, or at least it was for me the first times I had seen it, but I think it's a nice simple way to guarantee the return type as undefined, as you suggest.

@sirreal sirreal marked this pull request as ready for review December 12, 2019 08:45
@sirreal sirreal requested a review from aduth as a code owner December 12, 2019 08:45
@sirreal sirreal added [Package] DOM ready /packages/dom-ready [Type] Code Quality Issues or PRs that relate to code quality labels Dec 12, 2019
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

This will need a rebase after #19099 was merged (it will take some time for the "include" to populate a bit more before we can avoid such frequent merge conflicts 😬 ).

@sirreal sirreal force-pushed the add/types-dom-ready branch from 47bcfaf to 8489ad3 Compare December 12, 2019 14:08
@sirreal
Copy link
Member Author

sirreal commented Dec 12, 2019

Rebased.

@sirreal sirreal force-pushed the add/types-dom-ready branch from 58117e8 to ac78666 Compare December 12, 2019 16:02
@sirreal sirreal requested a review from aduth December 12, 2019 16:02
@sirreal sirreal merged commit 674a0c9 into master Dec 12, 2019
@sirreal sirreal deleted the add/types-dom-ready branch December 12, 2019 16:54
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] DOM ready /packages/dom-ready [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants