@lvce-editor/auth-worker 3.9.0 → 3.11.0
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/authWorkerMain.js +28 -28
- package/package.json +1 -1
package/dist/authWorkerMain.js
CHANGED
|
@@ -906,6 +906,34 @@ const listen$1 = async (module, options) => {
|
|
|
906
906
|
return ipc;
|
|
907
907
|
};
|
|
908
908
|
|
|
909
|
+
const createSharedLazyRpc = factory => {
|
|
910
|
+
let rpcPromise;
|
|
911
|
+
const getOrCreate = () => {
|
|
912
|
+
if (!rpcPromise) {
|
|
913
|
+
rpcPromise = factory();
|
|
914
|
+
}
|
|
915
|
+
return rpcPromise;
|
|
916
|
+
};
|
|
917
|
+
return {
|
|
918
|
+
async dispose() {
|
|
919
|
+
const rpc = await getOrCreate();
|
|
920
|
+
await rpc.dispose();
|
|
921
|
+
},
|
|
922
|
+
async invoke(method, ...params) {
|
|
923
|
+
const rpc = await getOrCreate();
|
|
924
|
+
return rpc.invoke(method, ...params);
|
|
925
|
+
},
|
|
926
|
+
async invokeAndTransfer(method, ...params) {
|
|
927
|
+
const rpc = await getOrCreate();
|
|
928
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
929
|
+
},
|
|
930
|
+
async send(method, ...params) {
|
|
931
|
+
const rpc = await getOrCreate();
|
|
932
|
+
rpc.send(method, ...params);
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
};
|
|
936
|
+
|
|
909
937
|
const create$4 = async ({
|
|
910
938
|
commandMap,
|
|
911
939
|
isMessagePortOpen = true,
|
|
@@ -941,34 +969,6 @@ const create$3 = async ({
|
|
|
941
969
|
});
|
|
942
970
|
};
|
|
943
971
|
|
|
944
|
-
const createSharedLazyRpc = factory => {
|
|
945
|
-
let rpcPromise;
|
|
946
|
-
const getOrCreate = () => {
|
|
947
|
-
if (!rpcPromise) {
|
|
948
|
-
rpcPromise = factory();
|
|
949
|
-
}
|
|
950
|
-
return rpcPromise;
|
|
951
|
-
};
|
|
952
|
-
return {
|
|
953
|
-
async dispose() {
|
|
954
|
-
const rpc = await getOrCreate();
|
|
955
|
-
await rpc.dispose();
|
|
956
|
-
},
|
|
957
|
-
async invoke(method, ...params) {
|
|
958
|
-
const rpc = await getOrCreate();
|
|
959
|
-
return rpc.invoke(method, ...params);
|
|
960
|
-
},
|
|
961
|
-
async invokeAndTransfer(method, ...params) {
|
|
962
|
-
const rpc = await getOrCreate();
|
|
963
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
964
|
-
},
|
|
965
|
-
async send(method, ...params) {
|
|
966
|
-
const rpc = await getOrCreate();
|
|
967
|
-
rpc.send(method, ...params);
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
};
|
|
971
|
-
|
|
972
972
|
const create$2 = async ({
|
|
973
973
|
commandMap,
|
|
974
974
|
isMessagePortOpen,
|