-
Notifications
You must be signed in to change notification settings - Fork 425
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
more precise type annotation for WildCardEventHandler #58
Conversation
I might have to ask @aweary for help reviewing 😇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's cool that flow supports typing based on literal values. I think this is 👍, pending my comment.
src/index.js
Outdated
// A map of event types and their corresponding event handlers. | ||
type EventHandlerMap = { | ||
'*': WildCardEventHandlerList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be:
'*'?: WildCardEventHandlerList
Otherwise, it means that EventHandlerMap
should always have a "*"
key
hi @aweary, I addressed your comment. Thank you! |
@developit @aweary is this good to merge? |
any progress on this? would be great to have this fixed, maybe @tunnckoCore can handle this? |
Hey, thanks for the ping. I'll try to review it soon :) |
Seems okey, probably... but i'm not so TS/Flow guy like @developit ;d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW it looks good to me
@developit one last thing - could this be released to npm? :) |
an attempt to get away with the hack in type annotation from the previous fix