Skip to content

Conversation

@vpavkin
Copy link
Contributor

@vpavkin vpavkin commented Aug 22, 2015

I write a js library, that converts scala Futures into javascript Promises. To instantiate a Promise within scala.js code it needs to be a class

Copy link
Member

Choose a reason for hiding this comment

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

Use Any or _ as the result type of functions instead of Unit. It helps with inference in some cases. The caller of the function does not demand that a Unit be returned; it doesn't care what value is returned because it ignores it. So Any is more appropriate.

@sjrd
Copy link
Member

sjrd commented Aug 22, 2015

That's all. Please amend and force-push your commit to the PR branch, then comment on the PR to notify me.

@vpavkin
Copy link
Contributor Author

vpavkin commented Aug 22, 2015

@sjrd Done! Thanks for feedback!

@sjrd
Copy link
Member

sjrd commented Aug 22, 2015

LGTM

sjrd added a commit that referenced this pull request Aug 22, 2015
Turn Promise trait into a class with executor constructor parameter.
@sjrd sjrd merged commit 9e7bee8 into scala-js:master Aug 22, 2015
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.

2 participants