From: Jérôme Benoit Date: Tue, 23 Aug 2022 12:48:40 +0000 (+0200) Subject: Simplify BroadcastChannel classes inheritance X-Git-Tag: v1.1.66~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1598b27c55255d49693d67950242661fefbe1d7d;p=e-mobility-charging-stations-simulator.git Simplify BroadcastChannel classes inheritance Signed-off-by: Jérôme Benoit --- 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; }