Load web workers in a way that Webpack 5 can bundle them
This commit is contained in:
parent
cfd5165cd8
commit
84d7d43a0d
5 changed files with 13 additions and 12 deletions
|
@ -23,8 +23,8 @@ export class WorkerManager<Request extends {}, Response> {
|
|||
private seq = 0;
|
||||
private pendingDeferredMap = new Map<number, IDeferred<Response>>();
|
||||
|
||||
public constructor(WorkerConstructor: { new (): Worker }) {
|
||||
this.worker = new WorkerConstructor();
|
||||
public constructor(worker: Worker) {
|
||||
this.worker = worker;
|
||||
this.worker.onmessage = this.onMessage;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue