mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-14 23:00:01 -04:00
rename setTransport to setManualTransport
This commit is contained in:
parent
cad770e2d1
commit
fb8fe1d306
3 changed files with 18 additions and 4 deletions
|
@ -107,10 +107,17 @@ export class BareMuxConnection {
|
|||
this.worker = new WorkerConnection(workerPath);
|
||||
}
|
||||
|
||||
async setTransport(transport: string) {
|
||||
async setTransport(path: string, options: any[]) {
|
||||
await this.setManualTransport(`
|
||||
const { default: BareTransport } = await import("${path}");
|
||||
return new BareTransport(${options.map(x => JSON.stringify(x)).join(", ")});
|
||||
`);
|
||||
}
|
||||
|
||||
async setManualTransport(functionBody: string) {
|
||||
await this.worker.sendMessage({
|
||||
type: "set",
|
||||
client: transport,
|
||||
client: functionBody,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue