Skip to content

Conversation

cornerman
Copy link
Contributor

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

Also wants some love from sbt scalafmt.

*
* MDN
*/
def showNotification(title: String, options: NotificationOptions = ???): js.Promise[Event] = js.native
Copy link
Member

Choose a reason for hiding this comment

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

The result type should be js.Promise[Unit], not js.Promise[Event]. The spec says that the promise is completed with undefined, whose type in Scala.js is Unit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, sorry for the oversight

*
* MDN
*/
def getNotifications(options: GetNotificationOptions = ???): js.Promise[js.Array[Notification]] = js.native
Copy link
Member

Choose a reason for hiding this comment

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

You should use Sequence instead of js.Array here. (Sequence is defined here)

@cornerman cornerman force-pushed the serviceworker-registration-notification branch from 89b0fac to 3f1bbd6 Compare March 18, 2018 10:42
@sjrd sjrd merged commit c1293e4 into scala-js:master Mar 18, 2018
@cornerman cornerman deleted the serviceworker-registration-notification branch March 18, 2018 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants