@lvce-editor/ipc 3.7.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +7 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -41,6 +41,11 @@ const wrap$3 = global => {
|
|
|
41
41
|
};
|
|
42
42
|
this.listener = listener;
|
|
43
43
|
this.global.onmessage = wrappedListener;
|
|
44
|
+
},
|
|
45
|
+
dispose() {
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
this.listener = null;
|
|
48
|
+
this.global.onmessage = null;
|
|
44
49
|
}
|
|
45
50
|
};
|
|
46
51
|
};
|
|
@@ -284,6 +289,7 @@ const waitForFirstMessage = async port => {
|
|
|
284
289
|
|
|
285
290
|
const listen$1 = async () => {
|
|
286
291
|
const parentIpcRaw = listen$2();
|
|
292
|
+
signal$1(parentIpcRaw);
|
|
287
293
|
const parentIpc = wrap$3(parentIpcRaw);
|
|
288
294
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
289
295
|
if (firstMessage.method !== 'initialize') {
|
|
@@ -291,6 +297,7 @@ const listen$1 = async () => {
|
|
|
291
297
|
}
|
|
292
298
|
const type = firstMessage.params[0];
|
|
293
299
|
if (type === 'message-port') {
|
|
300
|
+
parentIpc.dispose();
|
|
294
301
|
const port = firstMessage.params[1];
|
|
295
302
|
return port;
|
|
296
303
|
}
|
package/dist/index.js
CHANGED
|
@@ -335,6 +335,11 @@ const wrap$8 = global => {
|
|
|
335
335
|
};
|
|
336
336
|
this.listener = listener;
|
|
337
337
|
this.global.onmessage = wrappedListener;
|
|
338
|
+
},
|
|
339
|
+
dispose() {
|
|
340
|
+
// @ts-ignore
|
|
341
|
+
this.listener = null;
|
|
342
|
+
this.global.onmessage = null;
|
|
338
343
|
}
|
|
339
344
|
};
|
|
340
345
|
};
|
|
@@ -377,6 +382,7 @@ const waitForFirstMessage = async port => {
|
|
|
377
382
|
|
|
378
383
|
const listen$4 = async () => {
|
|
379
384
|
const parentIpcRaw = listen$5();
|
|
385
|
+
signal$2(parentIpcRaw);
|
|
380
386
|
const parentIpc = wrap$8(parentIpcRaw);
|
|
381
387
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
382
388
|
if (firstMessage.method !== 'initialize') {
|
|
@@ -384,6 +390,7 @@ const listen$4 = async () => {
|
|
|
384
390
|
}
|
|
385
391
|
const type = firstMessage.params[0];
|
|
386
392
|
if (type === 'message-port') {
|
|
393
|
+
parentIpc.dispose();
|
|
387
394
|
const port = firstMessage.params[1];
|
|
388
395
|
return port;
|
|
389
396
|
}
|