Files
2026-07-26 18:25:37 +09:00

20 lines
537 B
JavaScript

import Channel from "../channel.js";
export default class extends Channel {
chName = "shogi";
static shouldShare = true;
static requireCredential = true;
constructor(id, connection){
super(id, connection);
this.onEvent = this.onEvent.bind(this);
}
async init(params) {
this.subscriber.on(`shogiStream:${this.user.id}`, this.onEvent);
}
onEvent(data) {
this.send(data);
}
dispose() {
this.subscriber.off(`shogiStream:${this.user.id}`, this.onEvent);
}
}