monocules.ws-client
v1.1.0
Published
WebSocket promise wrapper
Downloads
9
Maintainers
Readme
import WS from 'monocules.ws-client'
WS
.connect('my-connect-name', {
url : 'localhost:3000',
options : {
...
}
})
.then(
success => {
let pub1 = WS.publish('my-connect-name', {...});
pub1.then(
success => { ... },
error => { ... }
)
let pub2 = WS.publish('my-connect-name.my-namespace', {...}); // Namespace
pub2.then(
success => { ... },
error => { ... }
)
},
error => {
console.log(error);
}
);
Installation
$ npm install monocules.ws-client