phecda-core 1.6.0 → 2.0.0-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.ts +16 -10
- package/dist/index.global.js +155 -77
- package/dist/index.js +164 -81
- package/dist/index.mjs +155 -77
- package/dist/preset/index.global.js +7 -5
- package/dist/preset/index.js +7 -5
- package/dist/preset/index.mjs +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ interface PhecdaHandler {
|
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}
|
|
14
14
|
interface Phecda {
|
|
15
|
+
prototype: any;
|
|
15
16
|
_namespace: {
|
|
16
17
|
__INIT_EVENT__: Set<PropertyKey>;
|
|
17
18
|
__EXPOSE_VAR__: Set<PropertyKey>;
|
|
@@ -92,22 +93,26 @@ declare function Inject<K extends keyof PhecdaInjectData>(key: K): PhecdaInjectD
|
|
|
92
93
|
|
|
93
94
|
declare function validate(p: RegExp | string | Function | Object | Number, v: any): Promise<any>;
|
|
94
95
|
declare function getTag<M extends new (...args: any) => any>(Model: M): any;
|
|
95
|
-
declare function mergeOptions(obj1: any, obj2?: any): any;
|
|
96
96
|
|
|
97
97
|
declare function isPhecda(target: any): any;
|
|
98
98
|
declare function init(target: Phecda): void;
|
|
99
99
|
declare function regisInitEvent(target: Phecda, key: string): void;
|
|
100
|
-
declare function
|
|
101
|
-
declare function
|
|
100
|
+
declare function getOwnInitEvent(target: Phecda): string[];
|
|
101
|
+
declare function getInitEvent(target: Phecda): PropertyKey[];
|
|
102
|
+
declare function setModelVar(target: Phecda, key: PropertyKey): void;
|
|
102
103
|
declare function setExposeKey(target: Phecda, key: PropertyKey): void;
|
|
103
104
|
declare function setIgnoreKey(target: Phecda, key: PropertyKey): void;
|
|
104
|
-
declare function
|
|
105
|
-
declare function
|
|
106
|
-
declare function
|
|
105
|
+
declare function getOwnModelState(target: Phecda): string[];
|
|
106
|
+
declare function getModelState(target: Phecda): PropertyKey[];
|
|
107
|
+
declare function getOwnExposeKey(target: Phecda): string[];
|
|
108
|
+
declare function getExposeKey(target: Phecda): PropertyKey[];
|
|
109
|
+
declare function getOwnIgnoreKey(target: Phecda): string[];
|
|
107
110
|
declare function regisHandler(target: Phecda, key: PropertyKey, handler: PhecdaHandler): void;
|
|
108
|
-
declare function
|
|
109
|
-
declare function
|
|
110
|
-
declare function
|
|
111
|
+
declare function getOwnHandler(target: Phecda, key: PropertyKey): PhecdaHandler[];
|
|
112
|
+
declare function getHandler(target: Phecda, key: PropertyKey): any[];
|
|
113
|
+
declare function setState(target: Phecda, key: PropertyKey, state: Record<string, any>): void;
|
|
114
|
+
declare function getOwnState(target: Phecda, key: PropertyKey): Object;
|
|
115
|
+
declare function getState(target: Phecda, key: PropertyKey): any;
|
|
111
116
|
declare function register(instance: Phecda): void;
|
|
112
117
|
declare function registerAsync(instance: Phecda): Promise<void>;
|
|
113
118
|
|
|
@@ -118,6 +123,7 @@ declare function getProperty(key: string): any;
|
|
|
118
123
|
declare function Watcher(eventName: keyof Events, options?: {
|
|
119
124
|
once: boolean;
|
|
120
125
|
}): (obj: any, key: string) => void;
|
|
126
|
+
declare function Effect(eventName: string, options?: any): (obj: any, key: string) => void;
|
|
121
127
|
declare function Storage(storeKey?: string): (target: any, key?: PropertyKey) => void;
|
|
122
128
|
|
|
123
|
-
export { Assign, Bind, ClassValue, Clear, DataMap, Empty, Err, Events, Expose, Global, Ignore, Init, Inject, NameSpace, Phecda, PhecdaHandler, PhecdaInjectData, Pipe, Provide, Rule, Storage, Tag, UsePipeOptions, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler,
|
|
129
|
+
export { Assign, Bind, ClassValue, Clear, DataMap, Effect, Empty, Err, Events, Expose, Global, Ignore, Init, Inject, NameSpace, Phecda, PhecdaHandler, PhecdaInjectData, Pipe, Provide, Rule, Storage, Tag, UsePipeOptions, Watcher, activeInstance, addDecoToClass, classToValue, getBind, getExposeKey, getHandler, getInitEvent, getModelState, getOwnExposeKey, getOwnHandler, getOwnIgnoreKey, getOwnInitEvent, getOwnModelState, getOwnState, getProperty, getState, getTag, init, injectProperty, isPhecda, plainToClass, regisHandler, regisInitEvent, register, registerAsync, setExposeKey, setIgnoreKey, setModelVar, setState, snapShot, to, validate };
|
package/dist/index.global.js
CHANGED
|
@@ -26,6 +26,7 @@ var Phecda = (() => {
|
|
|
26
26
|
Bind: () => Bind,
|
|
27
27
|
Clear: () => Clear,
|
|
28
28
|
DataMap: () => DataMap,
|
|
29
|
+
Effect: () => Effect,
|
|
29
30
|
Empty: () => Empty,
|
|
30
31
|
Err: () => Err,
|
|
31
32
|
Expose: () => Expose,
|
|
@@ -45,17 +46,20 @@ var Phecda = (() => {
|
|
|
45
46
|
getBind: () => getBind,
|
|
46
47
|
getExposeKey: () => getExposeKey,
|
|
47
48
|
getHandler: () => getHandler,
|
|
48
|
-
getIgnoreKey: () => getIgnoreKey,
|
|
49
49
|
getInitEvent: () => getInitEvent,
|
|
50
50
|
getModelState: () => getModelState,
|
|
51
|
+
getOwnExposeKey: () => getOwnExposeKey,
|
|
52
|
+
getOwnHandler: () => getOwnHandler,
|
|
53
|
+
getOwnIgnoreKey: () => getOwnIgnoreKey,
|
|
54
|
+
getOwnInitEvent: () => getOwnInitEvent,
|
|
55
|
+
getOwnModelState: () => getOwnModelState,
|
|
56
|
+
getOwnState: () => getOwnState,
|
|
51
57
|
getProperty: () => getProperty,
|
|
52
58
|
getState: () => getState,
|
|
53
59
|
getTag: () => getTag,
|
|
54
60
|
init: () => init,
|
|
55
61
|
injectProperty: () => injectProperty,
|
|
56
62
|
isPhecda: () => isPhecda,
|
|
57
|
-
mergeOptions: () => mergeOptions,
|
|
58
|
-
mergeState: () => mergeState,
|
|
59
63
|
plainToClass: () => plainToClass,
|
|
60
64
|
regisHandler: () => regisHandler,
|
|
61
65
|
regisInitEvent: () => regisInitEvent,
|
|
@@ -63,58 +67,22 @@ var Phecda = (() => {
|
|
|
63
67
|
registerAsync: () => registerAsync,
|
|
64
68
|
setExposeKey: () => setExposeKey,
|
|
65
69
|
setIgnoreKey: () => setIgnoreKey,
|
|
66
|
-
|
|
70
|
+
setModelVar: () => setModelVar,
|
|
71
|
+
setState: () => setState,
|
|
67
72
|
snapShot: () => snapShot,
|
|
68
73
|
to: () => to,
|
|
69
74
|
validate: () => validate
|
|
70
75
|
});
|
|
71
76
|
|
|
72
|
-
// src/utils.ts
|
|
73
|
-
async function validate(p, v) {
|
|
74
|
-
if (typeof p === "string" || typeof p === "number") {
|
|
75
|
-
if (v === p)
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
if (typeof p === "function")
|
|
79
|
-
return p(v);
|
|
80
|
-
if (p instanceof RegExp)
|
|
81
|
-
return p.test(v);
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
__name(validate, "validate");
|
|
85
|
-
function getTag(Model) {
|
|
86
|
-
return Model.prototype?.__TAG__;
|
|
87
|
-
}
|
|
88
|
-
__name(getTag, "getTag");
|
|
89
|
-
function mergeOptions(obj1, obj2) {
|
|
90
|
-
if (!obj2)
|
|
91
|
-
return obj1;
|
|
92
|
-
for (const i in obj2) {
|
|
93
|
-
if (isObject(obj1[i]) && isObject(obj2[i])) {
|
|
94
|
-
mergeOptions(obj1[i], obj2[i]);
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
if (Array.isArray(obj1[i]) && Array.isArray(obj2[i])) {
|
|
98
|
-
obj1[i].push(...obj2[i].filter((item) => !obj1[i].includes(item)));
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
obj1[i] = obj2[i];
|
|
102
|
-
}
|
|
103
|
-
return obj1;
|
|
104
|
-
}
|
|
105
|
-
__name(mergeOptions, "mergeOptions");
|
|
106
|
-
function isObject(obj) {
|
|
107
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
108
|
-
}
|
|
109
|
-
__name(isObject, "isObject");
|
|
110
|
-
|
|
111
77
|
// src/core.ts
|
|
112
78
|
function isPhecda(target) {
|
|
113
79
|
return target && !!target.prototype._namespace;
|
|
114
80
|
}
|
|
115
81
|
__name(isPhecda, "isPhecda");
|
|
116
82
|
function init(target) {
|
|
117
|
-
if (!target
|
|
83
|
+
if (!target)
|
|
84
|
+
return;
|
|
85
|
+
if (!target.hasOwnProperty("_namespace")) {
|
|
118
86
|
target._namespace = {
|
|
119
87
|
__INIT_EVENT__: /* @__PURE__ */ new Set(),
|
|
120
88
|
__EXPOSE_VAR__: /* @__PURE__ */ new Set(),
|
|
@@ -131,19 +99,32 @@ var Phecda = (() => {
|
|
|
131
99
|
target._namespace.__INIT_EVENT__.add(key);
|
|
132
100
|
}
|
|
133
101
|
__name(regisInitEvent, "regisInitEvent");
|
|
134
|
-
function
|
|
135
|
-
|
|
102
|
+
function getOwnInitEvent(target) {
|
|
103
|
+
if (!target?._namespace)
|
|
104
|
+
return [];
|
|
136
105
|
return [
|
|
137
106
|
...target._namespace.__INIT_EVENT__
|
|
138
107
|
];
|
|
139
108
|
}
|
|
109
|
+
__name(getOwnInitEvent, "getOwnInitEvent");
|
|
110
|
+
function getInitEvent(target) {
|
|
111
|
+
let proto = Object.getPrototypeOf(target);
|
|
112
|
+
const set = /* @__PURE__ */ new Set();
|
|
113
|
+
while (proto?._namespace) {
|
|
114
|
+
proto._namespace.__INIT_EVENT__.forEach((item) => set.add(item));
|
|
115
|
+
proto = Object.getPrototypeOf(proto);
|
|
116
|
+
}
|
|
117
|
+
return [
|
|
118
|
+
...set
|
|
119
|
+
];
|
|
120
|
+
}
|
|
140
121
|
__name(getInitEvent, "getInitEvent");
|
|
141
|
-
function
|
|
122
|
+
function setModelVar(target, key) {
|
|
142
123
|
init(target);
|
|
143
124
|
target._namespace.__STATE_VAR__.add(key);
|
|
144
125
|
setExposeKey(target, key);
|
|
145
126
|
}
|
|
146
|
-
__name(
|
|
127
|
+
__name(setModelVar, "setModelVar");
|
|
147
128
|
function setExposeKey(target, key) {
|
|
148
129
|
init(target);
|
|
149
130
|
target._namespace.__EXPOSE_VAR__.add(key);
|
|
@@ -154,27 +135,54 @@ var Phecda = (() => {
|
|
|
154
135
|
target._namespace.__IGNORE_VAR__.add(key);
|
|
155
136
|
}
|
|
156
137
|
__name(setIgnoreKey, "setIgnoreKey");
|
|
157
|
-
function
|
|
158
|
-
|
|
138
|
+
function getOwnModelState(target) {
|
|
139
|
+
target = Object.getPrototypeOf(target);
|
|
159
140
|
return [
|
|
160
141
|
...target._namespace.__STATE_VAR__
|
|
161
142
|
];
|
|
162
143
|
}
|
|
144
|
+
__name(getOwnModelState, "getOwnModelState");
|
|
145
|
+
function getModelState(target) {
|
|
146
|
+
let proto = Object.getPrototypeOf(target);
|
|
147
|
+
const set = /* @__PURE__ */ new Set();
|
|
148
|
+
while (proto?._namespace) {
|
|
149
|
+
proto._namespace.__STATE_VAR__.forEach((item) => set.add(item));
|
|
150
|
+
proto = Object.getPrototypeOf(proto);
|
|
151
|
+
}
|
|
152
|
+
return [
|
|
153
|
+
...set
|
|
154
|
+
];
|
|
155
|
+
}
|
|
163
156
|
__name(getModelState, "getModelState");
|
|
164
|
-
function
|
|
165
|
-
|
|
157
|
+
function getOwnExposeKey(target) {
|
|
158
|
+
target = Object.getPrototypeOf(target);
|
|
166
159
|
return [
|
|
167
160
|
...target._namespace.__EXPOSE_VAR__
|
|
168
161
|
].filter((item) => !target._namespace.__IGNORE_VAR__.has(item));
|
|
169
162
|
}
|
|
163
|
+
__name(getOwnExposeKey, "getOwnExposeKey");
|
|
164
|
+
function getExposeKey(target) {
|
|
165
|
+
let proto = Object.getPrototypeOf(target);
|
|
166
|
+
const set = /* @__PURE__ */ new Set();
|
|
167
|
+
while (proto?._namespace) {
|
|
168
|
+
[
|
|
169
|
+
...proto._namespace.__EXPOSE_VAR__
|
|
170
|
+
].forEach((item) => !proto._namespace.__IGNORE_VAR__.has(item) && set.add(item));
|
|
171
|
+
proto = Object.getPrototypeOf(proto);
|
|
172
|
+
}
|
|
173
|
+
return [
|
|
174
|
+
...set
|
|
175
|
+
];
|
|
176
|
+
}
|
|
170
177
|
__name(getExposeKey, "getExposeKey");
|
|
171
|
-
function
|
|
172
|
-
|
|
178
|
+
function getOwnIgnoreKey(target) {
|
|
179
|
+
if (!target?._namespace)
|
|
180
|
+
return [];
|
|
173
181
|
return [
|
|
174
182
|
...target._namespace.__IGNORE_VAR__
|
|
175
183
|
];
|
|
176
184
|
}
|
|
177
|
-
__name(
|
|
185
|
+
__name(getOwnIgnoreKey, "getOwnIgnoreKey");
|
|
178
186
|
function regisHandler(target, key, handler) {
|
|
179
187
|
init(target);
|
|
180
188
|
if (!target._namespace.__STATE_HANDLER__.has(key))
|
|
@@ -185,22 +193,48 @@ var Phecda = (() => {
|
|
|
185
193
|
target._namespace.__STATE_HANDLER__.get(key).push(handler);
|
|
186
194
|
}
|
|
187
195
|
__name(regisHandler, "regisHandler");
|
|
188
|
-
function
|
|
196
|
+
function getOwnHandler(target, key) {
|
|
197
|
+
if (!target?._namespace)
|
|
198
|
+
return [];
|
|
189
199
|
return target._namespace.__STATE_HANDLER__.get(key) || [];
|
|
190
200
|
}
|
|
201
|
+
__name(getOwnHandler, "getOwnHandler");
|
|
202
|
+
function getHandler(target, key) {
|
|
203
|
+
let proto = Object.getPrototypeOf(target);
|
|
204
|
+
const set = /* @__PURE__ */ new Set();
|
|
205
|
+
while (proto?._namespace) {
|
|
206
|
+
proto._namespace.__STATE_HANDLER__.get(key)?.forEach((item) => set.add(item));
|
|
207
|
+
proto = Object.getPrototypeOf(proto);
|
|
208
|
+
}
|
|
209
|
+
return [
|
|
210
|
+
...set
|
|
211
|
+
];
|
|
212
|
+
}
|
|
191
213
|
__name(getHandler, "getHandler");
|
|
192
|
-
function
|
|
214
|
+
function setState(target, key, state) {
|
|
215
|
+
init(target);
|
|
193
216
|
const namespace = target._namespace.__STATE_NAMESPACE__;
|
|
194
|
-
|
|
195
|
-
namespace.set(key, state);
|
|
196
|
-
else
|
|
197
|
-
mergeOptions(namespace.get(key), state);
|
|
217
|
+
namespace.set(key, state);
|
|
198
218
|
}
|
|
199
|
-
__name(
|
|
219
|
+
__name(setState, "setState");
|
|
220
|
+
function getOwnState(target, key) {
|
|
221
|
+
target = Object.getPrototypeOf(target);
|
|
222
|
+
return target._namespace.__STATE_NAMESPACE__.get(key) || {};
|
|
223
|
+
}
|
|
224
|
+
__name(getOwnState, "getOwnState");
|
|
200
225
|
function getState(target, key) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
226
|
+
let proto = Object.getPrototypeOf(target);
|
|
227
|
+
let ret = {};
|
|
228
|
+
while (proto?._namespace) {
|
|
229
|
+
const state = proto._namespace.__STATE_NAMESPACE__.get(key);
|
|
230
|
+
if (state)
|
|
231
|
+
ret = {
|
|
232
|
+
...state,
|
|
233
|
+
...ret
|
|
234
|
+
};
|
|
235
|
+
proto = Object.getPrototypeOf(proto);
|
|
236
|
+
}
|
|
237
|
+
return ret;
|
|
204
238
|
}
|
|
205
239
|
__name(getState, "getState");
|
|
206
240
|
function register(instance) {
|
|
@@ -224,7 +258,7 @@ var Phecda = (() => {
|
|
|
224
258
|
|
|
225
259
|
// src/decorators.ts
|
|
226
260
|
function Init(target, key) {
|
|
227
|
-
|
|
261
|
+
setModelVar(target, key);
|
|
228
262
|
regisHandler(target, key, {
|
|
229
263
|
async init(instance) {
|
|
230
264
|
instance[key]();
|
|
@@ -234,8 +268,8 @@ var Phecda = (() => {
|
|
|
234
268
|
__name(Init, "Init");
|
|
235
269
|
function Bind(value) {
|
|
236
270
|
return (target, k) => {
|
|
237
|
-
|
|
238
|
-
|
|
271
|
+
setModelVar(target, k);
|
|
272
|
+
setState(target, k, {
|
|
239
273
|
value
|
|
240
274
|
});
|
|
241
275
|
};
|
|
@@ -243,7 +277,7 @@ var Phecda = (() => {
|
|
|
243
277
|
__name(Bind, "Bind");
|
|
244
278
|
function Rule(rule, info, meta) {
|
|
245
279
|
return (obj, key) => {
|
|
246
|
-
|
|
280
|
+
setModelVar(obj, key);
|
|
247
281
|
regisHandler(obj, key, {
|
|
248
282
|
rule,
|
|
249
283
|
info,
|
|
@@ -268,7 +302,7 @@ var Phecda = (() => {
|
|
|
268
302
|
__name(Clear, "Clear");
|
|
269
303
|
function Err(cb) {
|
|
270
304
|
return (target, key) => {
|
|
271
|
-
|
|
305
|
+
setModelVar(target, key);
|
|
272
306
|
regisHandler(target, key, {
|
|
273
307
|
error: cb
|
|
274
308
|
});
|
|
@@ -281,7 +315,7 @@ var Phecda = (() => {
|
|
|
281
315
|
__name(Expose, "Expose");
|
|
282
316
|
function Pipe(v) {
|
|
283
317
|
return (obj, key) => {
|
|
284
|
-
|
|
318
|
+
setModelVar(obj, key);
|
|
285
319
|
regisHandler(obj, key, {
|
|
286
320
|
async pipe(instance) {
|
|
287
321
|
const tasks = v.value;
|
|
@@ -301,7 +335,7 @@ var Phecda = (() => {
|
|
|
301
335
|
function Assign(cb) {
|
|
302
336
|
return (target) => {
|
|
303
337
|
init(target.prototype);
|
|
304
|
-
|
|
338
|
+
setModelVar(target.prototype, "__CLASS");
|
|
305
339
|
regisHandler(target.prototype, "__CLASS", {
|
|
306
340
|
init: async (instance) => {
|
|
307
341
|
const value = await cb(instance);
|
|
@@ -335,6 +369,24 @@ var Phecda = (() => {
|
|
|
335
369
|
}
|
|
336
370
|
__name(Inject, "Inject");
|
|
337
371
|
|
|
372
|
+
// src/utils.ts
|
|
373
|
+
async function validate(p, v) {
|
|
374
|
+
if (typeof p === "string" || typeof p === "number") {
|
|
375
|
+
if (v === p)
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
if (typeof p === "function")
|
|
379
|
+
return p(v);
|
|
380
|
+
if (p instanceof RegExp)
|
|
381
|
+
return p.test(v);
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
__name(validate, "validate");
|
|
385
|
+
function getTag(Model) {
|
|
386
|
+
return Model.prototype?.__TAG__;
|
|
387
|
+
}
|
|
388
|
+
__name(getTag, "getTag");
|
|
389
|
+
|
|
338
390
|
// src/helper.ts
|
|
339
391
|
function getBind(Model) {
|
|
340
392
|
const instance = new Model();
|
|
@@ -385,8 +437,8 @@ var Phecda = (() => {
|
|
|
385
437
|
__name(plainToClass, "plainToClass");
|
|
386
438
|
function classToValue(instance) {
|
|
387
439
|
const data = {};
|
|
388
|
-
const
|
|
389
|
-
for (const item of
|
|
440
|
+
const exposeVars = getExposeKey(instance);
|
|
441
|
+
for (const item of exposeVars)
|
|
390
442
|
data[item] = instance[item];
|
|
391
443
|
return data;
|
|
392
444
|
}
|
|
@@ -437,7 +489,7 @@ var Phecda = (() => {
|
|
|
437
489
|
// src/custom/decorator.ts
|
|
438
490
|
function Watcher(eventName, options) {
|
|
439
491
|
return (obj, key) => {
|
|
440
|
-
|
|
492
|
+
setModelVar(obj, key);
|
|
441
493
|
regisHandler(obj, key, {
|
|
442
494
|
init(instance) {
|
|
443
495
|
getProperty("watcher")?.({
|
|
@@ -451,6 +503,32 @@ var Phecda = (() => {
|
|
|
451
503
|
};
|
|
452
504
|
}
|
|
453
505
|
__name(Watcher, "Watcher");
|
|
506
|
+
function Effect(eventName, options) {
|
|
507
|
+
return (obj, key) => {
|
|
508
|
+
setModelVar(obj, key);
|
|
509
|
+
regisHandler(obj, key, {
|
|
510
|
+
init(instance) {
|
|
511
|
+
instance[`$_${key}`] = instance[key];
|
|
512
|
+
Object.defineProperty(instance, key, {
|
|
513
|
+
get() {
|
|
514
|
+
return instance[`$_${key}`];
|
|
515
|
+
},
|
|
516
|
+
set(v) {
|
|
517
|
+
instance[`$_${key}`] = v;
|
|
518
|
+
getProperty(`effect-${eventName}`)?.({
|
|
519
|
+
instance,
|
|
520
|
+
key,
|
|
521
|
+
value: v,
|
|
522
|
+
options
|
|
523
|
+
});
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
__name(Effect, "Effect");
|
|
454
532
|
function Storage(storeKey) {
|
|
455
533
|
return (target, key) => {
|
|
456
534
|
let tag;
|
|
@@ -458,7 +536,7 @@ var Phecda = (() => {
|
|
|
458
536
|
init(target);
|
|
459
537
|
tag = storeKey || target.__TAG__;
|
|
460
538
|
const uniTag = Symbol(tag);
|
|
461
|
-
|
|
539
|
+
setModelVar(target, uniTag);
|
|
462
540
|
regisHandler(target, uniTag, {
|
|
463
541
|
init: (instance) => {
|
|
464
542
|
getProperty("storage")?.({
|
|
@@ -472,7 +550,7 @@ var Phecda = (() => {
|
|
|
472
550
|
init(target.prototype);
|
|
473
551
|
tag = storeKey || `${target.prototype.__TAG__}_${key}`;
|
|
474
552
|
const uniTag = Symbol(tag);
|
|
475
|
-
|
|
553
|
+
setModelVar(target.prototype, uniTag);
|
|
476
554
|
regisHandler(target.prototype, uniTag, {
|
|
477
555
|
init: (instance) => {
|
|
478
556
|
getProperty("storage")?.({
|