Add Flow types for EventPluginHub#11465
Merged
gaearon merged 2 commits intofacebook:masterfrom Nov 15, 2017
dylanapplegate:add-event-plugin-hub-flow-types
Merged
Add Flow types for EventPluginHub#11465gaearon merged 2 commits intofacebook:masterfrom dylanapplegate:add-event-plugin-hub-flow-types
gaearon merged 2 commits intofacebook:masterfrom
dylanapplegate:add-event-plugin-hub-flow-types
Conversation
gaearon
reviewed
Nov 13, 2017
| eventQueue = null; | ||
| if (simulated) { | ||
|
|
||
| if (simulated && processingEventQueue) { |
Collaborator
There was a problem hiding this comment.
This seems a bit odd. If we don't want to do anything when processingEventQueue is empty, can we exit early instead? Otherwise we're directing simulated events into non-simulated branch (even though technically there's no events) which seems wrong.
| var executeDispatchesAndRelease = function(event, simulated) { | ||
| var executeDispatchesAndRelease = function( | ||
| event: ReactSyntheticEvent, | ||
| simulated, |
| var executeDispatchesAndRelease = function(event, simulated) { | ||
| var executeDispatchesAndRelease = function( | ||
| event: ReactSyntheticEvent, | ||
| simulated, |
| } | ||
| }; | ||
| var executeDispatchesAndReleaseSimulated = function(e) { | ||
| var executeDispatchesAndReleaseSimulated = function(e: ReactSyntheticEvent) { |
Collaborator
There was a problem hiding this comment.
Seems like this can be inferred? I'd prefer we annotate public APIs and low-level functions, but not all the glue code.
gaearon
approved these changes
Nov 15, 2017
Collaborator
|
I'm not very familiar with this code but as well might start learning it :-) This seems good to me. Thanks! |
Contributor
Author
|
No problem! I'll get a PR over later this week with a little more typing. |
Ethan-Arrowood
pushed a commit
to Ethan-Arrowood/react
that referenced
this pull request
Dec 8, 2017
* Add Flow types for EventPluginHub * add boolean and remove extraneous typing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added EventPluginHub Flow types. Please note, I ran into a weird bug in Flow where the order of the union types mattered. It's why one would see these sort of diffs in two of the files:
Tomorrow, I'll check the Flow project to see if there is already an open issue or resolution regarding the bug.