fromWebSocket
Arguments
Returns
Example
// Using a function for the open
var socket = Rx.DOM.fromWebSocket(
'http://localhost:8080',
'protocol',
function (e) {
console.log('Opening');
})
socket.subscribe(function (next) {
console.log('Received data: ' + next);
});
socket.onNext('data');
// Using an observer for the open
var observer = Rx.Observer.create(function (e) {
console.log('Opening');
});
var socket = Rx.DOM.fromWebSocket(
'http://localhost:8080', 'protocol', observer)
socket.subscribe(function (next) {
console.log('Received data: ' + next);
});
socket.onNext('data');Last updated