17 lines
281 B
TypeScript
17 lines
281 B
TypeScript
import {Emitter} from "@welshman/lib"
|
|
import type {Message} from "../Socket.js"
|
|
|
|
export class Echo extends Emitter {
|
|
get connections() {
|
|
return []
|
|
}
|
|
|
|
async send(...payload: Message) {
|
|
this.emit(...payload)
|
|
}
|
|
|
|
cleanup = () => {
|
|
this.removeAllListeners()
|
|
}
|
|
}
|