Forward UI request UUID to broadcast channel request
[e-mobility-charging-stations-simulator.git] / src / charging-station / WorkerBroadcastChannel.ts
1 import { BroadcastChannel } from 'worker_threads';
2
3 import { BroadcastChannelRequest } from '../types/WorkerBroadcastChannel';
4
5 export default class WorkerBroadcastChannel extends BroadcastChannel {
6 constructor() {
7 super('worker');
8 }
9
10 public sendRequest(request: BroadcastChannelRequest): void {
11 this.postMessage(request);
12 }
13 }