Sharkey/src/web/app/common/scripts/messaging-stream.ts
2017-11-14 00:55:11 +09:00

21 lines
315 B
TypeScript

import Stream from './stream';
/**
* Messaging stream connection
*/
class Connection extends Stream {
constructor(me, otherparty) {
super('messaging', {
i: me.token,
otherparty
});
(this as any).on('_connected_', () => {
this.send({
i: me.token
});
});
}
}
export default Connection;