Skip to content

Commit c521373

Browse files
author
Anton Eriksson
committed
fix(js): Revert attempted worker blob optimization
1 parent af195e2 commit c521373

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

interfaces/js/src/infomap.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ class Infomap {
1212

1313
_workerId = 0;
1414
_workers = {};
15-
_workerBlob = new Blob([InfomapWorker], { type: "application/javascript" });
1615

1716
initWorkerUrl() {
1817
if (this._workerUrl) return;
19-
this._workerUrl = URL.createObjectURL(this._workerBlob);
18+
const blob = new Blob([InfomapWorker], { type: "application/javascript" });
19+
this._workerUrl = URL.createObjectURL(blob);
2020
}
2121

2222
revokeWorkerUrl() {
@@ -99,10 +99,6 @@ class Infomap {
9999
}
100100

101101
delete this._workers[id];
102-
103-
if (Object.keys(this._workers).length === 0) {
104-
this.revokeWorkerUrl();
105-
}
106102
}
107103
}
108104

0 commit comments

Comments
 (0)