From 0bab0554419835c8615d9f2d70b7009213f1f4a3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 28 Jun 2021 18:34:10 +0900 Subject: [PATCH] refactor --- src/streaming.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/streaming.ts b/src/streaming.ts index 70cf0a4f2..26137d188 100644 --- a/src/streaming.ts +++ b/src/streaming.ts @@ -269,12 +269,9 @@ abstract class Connection extend } @autobind - public send(id: string, typeOrPayload: any, payload?: any) { - const type = payload === undefined ? typeOrPayload.type : typeOrPayload; - const body = payload === undefined ? typeOrPayload.body : payload; - + public send(type: T, body: Channel['receives'][T]) { this.stream.send('ch', { - id: id, + id: this.id, type: type, body: body }); @@ -299,11 +296,6 @@ class SharedConnection extends C this.pool.inc(); } - @autobind - public send(typeOrPayload: any, payload?: any) { - super.send(this.pool.id, typeOrPayload, payload); - } - @autobind public dispose() { this.pool.dec(); @@ -334,11 +326,6 @@ class NonSharedConnection extend }); } - @autobind - public send(typeOrPayload: any, payload?: any) { - super.send(this.id, typeOrPayload, payload); - } - @autobind public dispose() { this.removeAllListeners();