mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-15 07:10:00 -04:00
tell the sw to refresh its port when a new shared worker gets made
This commit is contained in:
parent
fb81b33714
commit
fde90f3ec1
2 changed files with 12 additions and 4 deletions
|
@ -1,9 +1,12 @@
|
|||
import { BareTransport } from "./baretypes";
|
||||
import { WorkerMessage, WorkerResponse } from "./connection"
|
||||
import { BroadcastMessage, WorkerMessage, WorkerResponse } from "./connection"
|
||||
|
||||
let currentTransport: BareTransport | null = null;
|
||||
let currentTransportName: string = "";
|
||||
|
||||
const channel = new BroadcastChannel("bare-mux");
|
||||
channel.postMessage(<BroadcastMessage>{ type: "refreshPort" });
|
||||
|
||||
function noClients(): Error {
|
||||
// @ts-expect-error mdn error constructor: new Error(message, options)
|
||||
return new Error("there are no bare clients", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue