Skip to content
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 style.js #5051

Merged
merged 1 commit into from Jul 31, 2017
Merged

Type style.js #5051

merged 1 commit into from Jul 31, 2017

Conversation

jfirebaugh
Copy link
Contributor

No description provided.

@@ -85,65 +127,78 @@ class Style extends Evented {
}
});

const stylesheetLoaded = (err, stylesheet) => {
const stylesheetLoaded = (err, stylesheet: ?StyleSpecification) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 should we typed this as mixed and then cast it to StyleSpecification after it passes validation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_layers: {[string]: StyleLayer};
_order: Array<string>;
sourceCaches: {[string]: SourceCache};
zoomHistory: ZoomHistory | {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this typed as ZoomHistory | {} rather than ?ZoomHistory to reduce invasiveness of the change? ( 👍 if so, just making sure )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly. ?ZoomHistory would be preferable but requires some refactoring.

@jfirebaugh jfirebaugh merged commit 3e7c509 into master Jul 31, 2017
@jfirebaugh jfirebaugh deleted the type-style branch July 31, 2017 19:52
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.

None yet

2 participants