How can I access the atmosphere API using Scala JS?
So say I have the following in javascript:
var socket = $.atmosphere
...
var request = {
url: "myurl/path",
...
};
request.onOpen = function(response) {
...
subSocket.push("init")
};
...
socket.subscribe(request);
What would its equivalent be in Scala JS?
I came up with the solution below:
Usage is then:
This way I can override the various properties/handlers for the request. I am wondering if this can be improved upon however. For example is there an alternative to the usage of JSName?