phecda-web 3.0.1 → 3.0.2-alpha.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/index.d.mts CHANGED
@@ -61,7 +61,7 @@ declare class WebPhecda {
61
61
  */
62
62
  memory: Record<string, any>;
63
63
  state: Record<string | symbol, any>;
64
- modelMap: WeakMap<object, any>;
64
+ modelMap: WeakMap<WeakKey, any>;
65
65
  emitter: mitt.Emitter<InternalEvents>;
66
66
  constructor(namespace: string, parseModule: <Instance = any>(instance: Instance) => Instance);
67
67
  private then;
package/dist/index.d.ts CHANGED
@@ -61,7 +61,7 @@ declare class WebPhecda {
61
61
  */
62
62
  memory: Record<string, any>;
63
63
  state: Record<string | symbol, any>;
64
- modelMap: WeakMap<object, any>;
64
+ modelMap: WeakMap<WeakKey, any>;
65
65
  emitter: mitt.Emitter<InternalEvents>;
66
66
  constructor(namespace: string, parseModule: <Instance = any>(instance: Instance) => Instance);
67
67
  private then;
package/dist/index.js CHANGED
@@ -30,8 +30,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
32
  // src/index.ts
33
- var src_exports = {};
34
- __export(src_exports, {
33
+ var index_exports = {};
34
+ __export(index_exports, {
35
35
  Mixin: () => import_ts_mixer.Mixin,
36
36
  WebBase: () => WebBase,
37
37
  WebPhecda: () => WebPhecda,
@@ -44,8 +44,8 @@ __export(src_exports, {
44
44
  phecdaNamespace: () => phecdaNamespace,
45
45
  setDefaultPhecda: () => setDefaultPhecda
46
46
  });
47
- module.exports = __toCommonJS(src_exports);
48
- __reExport(src_exports, require("phecda-core"), module.exports);
47
+ module.exports = __toCommonJS(index_exports);
48
+ __reExport(index_exports, require("phecda-core"), module.exports);
49
49
 
50
50
  // src/inject.ts
51
51
  var import_phecda_core = require("phecda-core");
@@ -258,6 +258,16 @@ var WebPhecda = class {
258
258
  const { state } = this;
259
259
  return this.modelMap.get(state[tag]);
260
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
+ // }
261
271
  reset(model) {
262
272
  const { state } = this;
263
273
  const tag = (0, import_phecda_core2.getTag)(model);
package/dist/index.mjs CHANGED
@@ -215,6 +215,16 @@ var WebPhecda = class {
215
215
  const { state } = this;
216
216
  return this.modelMap.get(state[tag]);
217
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
+ // }
218
228
  reset(model) {
219
229
  const { state } = this;
220
230
  const tag = getTag(model);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-web",
3
- "version": "3.0.1",
3
+ "version": "3.0.2-alpha.1",
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.1"
22
+ "phecda-core": "4.1.0-alpha.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.1.0"