@lvce-editor/extension-management-worker 4.52.6 → 4.54.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.
|
@@ -1083,6 +1083,34 @@ const listen$1 = async (module, options) => {
|
|
|
1083
1083
|
return ipc;
|
|
1084
1084
|
};
|
|
1085
1085
|
|
|
1086
|
+
const createSharedLazyRpc = factory => {
|
|
1087
|
+
let rpcPromise;
|
|
1088
|
+
const getOrCreate = () => {
|
|
1089
|
+
if (!rpcPromise) {
|
|
1090
|
+
rpcPromise = factory();
|
|
1091
|
+
}
|
|
1092
|
+
return rpcPromise;
|
|
1093
|
+
};
|
|
1094
|
+
return {
|
|
1095
|
+
async dispose() {
|
|
1096
|
+
const rpc = await getOrCreate();
|
|
1097
|
+
await rpc.dispose();
|
|
1098
|
+
},
|
|
1099
|
+
async invoke(method, ...params) {
|
|
1100
|
+
const rpc = await getOrCreate();
|
|
1101
|
+
return rpc.invoke(method, ...params);
|
|
1102
|
+
},
|
|
1103
|
+
async invokeAndTransfer(method, ...params) {
|
|
1104
|
+
const rpc = await getOrCreate();
|
|
1105
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1106
|
+
},
|
|
1107
|
+
async send(method, ...params) {
|
|
1108
|
+
const rpc = await getOrCreate();
|
|
1109
|
+
rpc.send(method, ...params);
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1086
1114
|
const create$8 = async ({
|
|
1087
1115
|
commandMap,
|
|
1088
1116
|
isMessagePortOpen = true,
|
|
@@ -1118,34 +1146,6 @@ const create$7 = async ({
|
|
|
1118
1146
|
});
|
|
1119
1147
|
};
|
|
1120
1148
|
|
|
1121
|
-
const createSharedLazyRpc = factory => {
|
|
1122
|
-
let rpcPromise;
|
|
1123
|
-
const getOrCreate = () => {
|
|
1124
|
-
if (!rpcPromise) {
|
|
1125
|
-
rpcPromise = factory();
|
|
1126
|
-
}
|
|
1127
|
-
return rpcPromise;
|
|
1128
|
-
};
|
|
1129
|
-
return {
|
|
1130
|
-
async dispose() {
|
|
1131
|
-
const rpc = await getOrCreate();
|
|
1132
|
-
await rpc.dispose();
|
|
1133
|
-
},
|
|
1134
|
-
async invoke(method, ...params) {
|
|
1135
|
-
const rpc = await getOrCreate();
|
|
1136
|
-
return rpc.invoke(method, ...params);
|
|
1137
|
-
},
|
|
1138
|
-
async invokeAndTransfer(method, ...params) {
|
|
1139
|
-
const rpc = await getOrCreate();
|
|
1140
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
1141
|
-
},
|
|
1142
|
-
async send(method, ...params) {
|
|
1143
|
-
const rpc = await getOrCreate();
|
|
1144
|
-
rpc.send(method, ...params);
|
|
1145
|
-
}
|
|
1146
|
-
};
|
|
1147
|
-
};
|
|
1148
|
-
|
|
1149
1149
|
const create$6 = async ({
|
|
1150
1150
|
commandMap,
|
|
1151
1151
|
isMessagePortOpen,
|