phecda-web 3.0.0 → 3.0.2-alpha.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/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +12 -8
- package/dist/index.mjs +12 -7
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -16,7 +16,6 @@ type DeepPartial<T> = {
|
|
|
16
16
|
declare const emitter: PhecdaEmitter;
|
|
17
17
|
declare function defaultWebInject(): void;
|
|
18
18
|
|
|
19
|
-
declare function wait(...instances: InstanceType<Construct>[]): Promise<any[]>;
|
|
20
19
|
declare function getParamtypes(Model: Construct): any;
|
|
21
20
|
declare const phecdaNamespace: Map<string, WebPhecda>;
|
|
22
21
|
declare function setDefaultPhecda(namespace: string, phecda: WebPhecda): void;
|
|
@@ -89,4 +88,4 @@ declare class WebBase extends Base {
|
|
|
89
88
|
emitter: PhecdaEmitter;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
export { type DeepPartial, type PhecdaEmitter, WebBase, WebPhecda, bindMethod, defaultWebInject, delDefaultPhecda, emitter, getDefaultPhecda, getParamtypes, phecdaNamespace, setDefaultPhecda
|
|
91
|
+
export { type DeepPartial, type PhecdaEmitter, WebBase, WebPhecda, bindMethod, defaultWebInject, delDefaultPhecda, emitter, getDefaultPhecda, getParamtypes, phecdaNamespace, setDefaultPhecda };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ type DeepPartial<T> = {
|
|
|
16
16
|
declare const emitter: PhecdaEmitter;
|
|
17
17
|
declare function defaultWebInject(): void;
|
|
18
18
|
|
|
19
|
-
declare function wait(...instances: InstanceType<Construct>[]): Promise<any[]>;
|
|
20
19
|
declare function getParamtypes(Model: Construct): any;
|
|
21
20
|
declare const phecdaNamespace: Map<string, WebPhecda>;
|
|
22
21
|
declare function setDefaultPhecda(namespace: string, phecda: WebPhecda): void;
|
|
@@ -89,4 +88,4 @@ declare class WebBase extends Base {
|
|
|
89
88
|
emitter: PhecdaEmitter;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
export { type DeepPartial, type PhecdaEmitter, WebBase, WebPhecda, bindMethod, defaultWebInject, delDefaultPhecda, emitter, getDefaultPhecda, getParamtypes, phecdaNamespace, setDefaultPhecda
|
|
91
|
+
export { type DeepPartial, type PhecdaEmitter, WebBase, WebPhecda, bindMethod, defaultWebInject, delDefaultPhecda, emitter, getDefaultPhecda, getParamtypes, phecdaNamespace, setDefaultPhecda };
|
package/dist/index.js
CHANGED
|
@@ -42,8 +42,7 @@ __export(src_exports, {
|
|
|
42
42
|
getDefaultPhecda: () => getDefaultPhecda,
|
|
43
43
|
getParamtypes: () => getParamtypes,
|
|
44
44
|
phecdaNamespace: () => phecdaNamespace,
|
|
45
|
-
setDefaultPhecda: () => setDefaultPhecda
|
|
46
|
-
wait: () => wait
|
|
45
|
+
setDefaultPhecda: () => setDefaultPhecda
|
|
47
46
|
});
|
|
48
47
|
module.exports = __toCommonJS(src_exports);
|
|
49
48
|
__reExport(src_exports, require("phecda-core"), module.exports);
|
|
@@ -117,10 +116,6 @@ function deepMerge(target, patchToApply) {
|
|
|
117
116
|
__name(deepMerge, "deepMerge");
|
|
118
117
|
|
|
119
118
|
// src/core.ts
|
|
120
|
-
function wait(...instances) {
|
|
121
|
-
return Promise.all(instances.map((i) => i.__PROMISE_SYMBOL__));
|
|
122
|
-
}
|
|
123
|
-
__name(wait, "wait");
|
|
124
119
|
function getParamtypes(Model) {
|
|
125
120
|
return Reflect.getMetadata("design:paramtypes", Model);
|
|
126
121
|
}
|
|
@@ -184,7 +179,7 @@ var WebPhecda = class {
|
|
|
184
179
|
then(onfulfilled, onrejected) {
|
|
185
180
|
const then = this.then;
|
|
186
181
|
this.then = void 0;
|
|
187
|
-
wait(...Object.values(this.state)).then(() => onfulfilled?.(this), onrejected).then(() => {
|
|
182
|
+
(0, import_phecda_core2.wait)(...Object.values(this.state)).then(() => onfulfilled?.(this), onrejected).then(() => {
|
|
188
183
|
this.then = then;
|
|
189
184
|
});
|
|
190
185
|
return this;
|
|
@@ -263,6 +258,16 @@ var WebPhecda = class {
|
|
|
263
258
|
const { state } = this;
|
|
264
259
|
return this.modelMap.get(state[tag]);
|
|
265
260
|
}
|
|
261
|
+
// replace<Model extends Construct>(model: Model) {
|
|
262
|
+
// const { state, modelMap } = this
|
|
263
|
+
// const tag = getTag(model)
|
|
264
|
+
// if (tag in state) {
|
|
265
|
+
// modelMap.delete(state[tag])
|
|
266
|
+
// delete state[tag]
|
|
267
|
+
// }
|
|
268
|
+
// console.log(this.init(model), tag)
|
|
269
|
+
// return this.init(model)
|
|
270
|
+
// }
|
|
266
271
|
reset(model) {
|
|
267
272
|
const { state } = this;
|
|
268
273
|
const tag = (0, import_phecda_core2.getTag)(model);
|
|
@@ -345,6 +350,5 @@ var import_ts_mixer = require("ts-mixer");
|
|
|
345
350
|
getParamtypes,
|
|
346
351
|
phecdaNamespace,
|
|
347
352
|
setDefaultPhecda,
|
|
348
|
-
wait,
|
|
349
353
|
...require("phecda-core")
|
|
350
354
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -48,7 +48,7 @@ function defaultWebInject() {
|
|
|
48
48
|
__name(defaultWebInject, "defaultWebInject");
|
|
49
49
|
|
|
50
50
|
// src/core.ts
|
|
51
|
-
import { get, getTag, invokeInit, invokeUnmount } from "phecda-core";
|
|
51
|
+
import { get, getTag, invokeInit, invokeUnmount, wait } from "phecda-core";
|
|
52
52
|
import "reflect-metadata";
|
|
53
53
|
import mitt2 from "mitt";
|
|
54
54
|
|
|
@@ -73,10 +73,6 @@ function deepMerge(target, patchToApply) {
|
|
|
73
73
|
__name(deepMerge, "deepMerge");
|
|
74
74
|
|
|
75
75
|
// src/core.ts
|
|
76
|
-
function wait(...instances) {
|
|
77
|
-
return Promise.all(instances.map((i) => i.__PROMISE_SYMBOL__));
|
|
78
|
-
}
|
|
79
|
-
__name(wait, "wait");
|
|
80
76
|
function getParamtypes(Model) {
|
|
81
77
|
return Reflect.getMetadata("design:paramtypes", Model);
|
|
82
78
|
}
|
|
@@ -219,6 +215,16 @@ var WebPhecda = class {
|
|
|
219
215
|
const { state } = this;
|
|
220
216
|
return this.modelMap.get(state[tag]);
|
|
221
217
|
}
|
|
218
|
+
// replace<Model extends Construct>(model: Model) {
|
|
219
|
+
// const { state, modelMap } = this
|
|
220
|
+
// const tag = getTag(model)
|
|
221
|
+
// if (tag in state) {
|
|
222
|
+
// modelMap.delete(state[tag])
|
|
223
|
+
// delete state[tag]
|
|
224
|
+
// }
|
|
225
|
+
// console.log(this.init(model), tag)
|
|
226
|
+
// return this.init(model)
|
|
227
|
+
// }
|
|
222
228
|
reset(model) {
|
|
223
229
|
const { state } = this;
|
|
224
230
|
const tag = getTag(model);
|
|
@@ -299,6 +305,5 @@ export {
|
|
|
299
305
|
getDefaultPhecda,
|
|
300
306
|
getParamtypes,
|
|
301
307
|
phecdaNamespace,
|
|
302
|
-
setDefaultPhecda
|
|
303
|
-
wait
|
|
308
|
+
setDefaultPhecda
|
|
304
309
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phecda-web",
|
|
3
|
-
"version": "3.0.0",
|
|
3
|
+
"version": "3.0.2-alpha.0",
|
|
4
4
|
"description": "using proxy, provide phecda function to web app",
|
|
5
5
|
"author": "fgsreally",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"mitt": "^3.0.0",
|
|
20
20
|
"reflect-metadata": "^0.1.13",
|
|
21
21
|
"ts-mixer": "^6.0.4",
|
|
22
|
-
"phecda-core": "4.0.0"
|
|
22
|
+
"phecda-core": "4.1.0-alpha.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"tsup": "^8.1.0"
|