-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Type ajax.js and evented.js #4955
Conversation
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.
One question inline
src/util/mapbox.js
Outdated
@@ -12,7 +12,7 @@ type UrlObject = {| | |||
params: Array<string> | |||
|}; | |||
|
|||
function makeAPIURL(urlObject: UrlObject, accessToken): string { | |||
function makeAPIURL(urlObject: UrlObject, accessToken?: ?string): string { |
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.
Why both optional and maybe-string?
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 needs (and is able) to accept both null
and undefined
. It would be clearer to write this as accessToken: string | null | void
though -- I'll switch.
src/util/evented.js
Outdated
* @returns {Object} `this` | ||
*/ | ||
setEventedParent(parent, data) { | ||
setEventedParent(parent: ?Evented, data?: Object) { |
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.
Oh, just saw: should data
be Object | () => Object
?
No description provided.