phecda-web 1.0.1-beta.10 → 1.0.1-beta.11

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.ts CHANGED
@@ -20,8 +20,8 @@ declare function waitUntilInit(...instances: InstanceType<Construct>[]): Promise
20
20
  declare function resetActiveInstance(instance?: ActiveInstance): void;
21
21
  declare function getActiveInstance(): ActiveInstance;
22
22
  declare function serializeState(): any;
23
- declare function isModuleLoad(module: Construct): boolean;
24
- declare function unmountModule(module: Construct | PropertyKey): Promise<void>;
23
+ declare function isModuleLoad(model: Construct): boolean;
24
+ declare function unmountModule(model: Construct | PropertyKey): Promise<void>;
25
25
 
26
26
  declare class P {
27
27
  constructor();
package/dist/index.js CHANGED
@@ -108,23 +108,23 @@ function serializeState() {
108
108
  return JSON.parse(JSON.stringify(activeInstance.state));
109
109
  }
110
110
  __name(serializeState, "serializeState");
111
- function isModuleLoad(module2) {
111
+ function isModuleLoad(model) {
112
112
  const { origin, state } = getActiveInstance();
113
- const tag = (0, import_phecda_core2.getTag)(module2);
113
+ const tag = (0, import_phecda_core2.getTag)(model);
114
114
  if (tag in state) {
115
- if (origin.get(state[tag]) !== module2)
116
- throw new Error(`Synonym module: Module taged "${String(tag)}" (but not "${module2.name}") has been loaded before`);
115
+ if (origin.get(state[tag]) !== model)
116
+ throw new Error(`Synonym module: Module taged "${String(tag)}" (but not "${model.name}") has been loaded before`);
117
117
  return true;
118
118
  }
119
119
  return false;
120
120
  }
121
121
  __name(isModuleLoad, "isModuleLoad");
122
- async function unmountModule(module2) {
123
- if (typeof module2 === "object")
124
- module2 = (0, import_phecda_core2.getTag)(module2);
122
+ async function unmountModule(model) {
123
+ if (typeof model === "object")
124
+ model = (0, import_phecda_core2.getTag)(model);
125
125
  const { state } = getActiveInstance();
126
- await (0, import_phecda_core2.invokeHandler)("unmount", state[module2]);
127
- delete state[module2];
126
+ await (0, import_phecda_core2.invokeHandler)("unmount", state[model]);
127
+ delete state[model];
128
128
  }
129
129
  __name(unmountModule, "unmountModule");
130
130
 
package/dist/index.mjs CHANGED
@@ -71,23 +71,23 @@ function serializeState() {
71
71
  return JSON.parse(JSON.stringify(activeInstance.state));
72
72
  }
73
73
  __name(serializeState, "serializeState");
74
- function isModuleLoad(module) {
74
+ function isModuleLoad(model) {
75
75
  const { origin, state } = getActiveInstance();
76
- const tag = getTag(module);
76
+ const tag = getTag(model);
77
77
  if (tag in state) {
78
- if (origin.get(state[tag]) !== module)
79
- throw new Error(`Synonym module: Module taged "${String(tag)}" (but not "${module.name}") has been loaded before`);
78
+ if (origin.get(state[tag]) !== model)
79
+ throw new Error(`Synonym module: Module taged "${String(tag)}" (but not "${model.name}") has been loaded before`);
80
80
  return true;
81
81
  }
82
82
  return false;
83
83
  }
84
84
  __name(isModuleLoad, "isModuleLoad");
85
- async function unmountModule(module) {
86
- if (typeof module === "object")
87
- module = getTag(module);
85
+ async function unmountModule(model) {
86
+ if (typeof model === "object")
87
+ model = getTag(model);
88
88
  const { state } = getActiveInstance();
89
- await invokeHandler("unmount", state[module]);
90
- delete state[module];
89
+ await invokeHandler("unmount", state[model]);
90
+ delete state[model];
91
91
  }
92
92
  __name(unmountModule, "unmountModule");
93
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-web",
3
- "version": "1.0.1-beta.10",
3
+ "version": "1.0.1-beta.11",
4
4
  "description": "provide web function for phecda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -13,7 +13,7 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "mitt": "^3.0.0",
16
- "phecda-core": "3.0.0-beta.13"
16
+ "phecda-core": "3.0.0-beta.14"
17
17
  },
18
18
  "devDependencies": {
19
19
  "tsup": "^6.5.0"