From 1598b27c55255d49693d67950242661fefbe1d7d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 23 Aug 2022 14:48:40 +0200 Subject: [PATCH] Simplify BroadcastChannel classes inheritance MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../ChargingStationWorkerBroadcastChannel.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 5115d6cf..edb7475a 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -1,5 +1,3 @@ -import { BroadcastChannel } from 'worker_threads'; - import { RequestCommand } from '../types/ocpp/Requests'; import { StartTransactionRequest, @@ -13,14 +11,15 @@ import { BroadcastChannelRequest, } from '../types/WorkerBroadcastChannel'; import ChargingStation from './ChargingStation'; +import WorkerBroadcastChannel from './WorkerBroadcastChannel'; type MessageEvent = { data: unknown }; -export default class ChargingStationWorkerBroadcastChannel extends BroadcastChannel { +export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChannel { private readonly chargingStation: ChargingStation; constructor(chargingStation: ChargingStation) { - super('worker'); + super(); this.chargingStation = chargingStation; this.onmessage = this.handleRequest.bind(this) as (message: MessageEvent) => void; } -- 2.34.1