@expressive/mvc 0.50.1 → 0.51.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.js +5 -7
- package/dist/index.mjs +5 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -155,13 +155,13 @@ function effect(target, callback, requireValues) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// src/model.ts
|
|
158
|
-
var EXPORT;
|
|
159
158
|
var NAMES = /* @__PURE__ */ new WeakMap();
|
|
160
159
|
var STATE = /* @__PURE__ */ new WeakMap();
|
|
161
160
|
var NOTIFY = /* @__PURE__ */ new WeakMap();
|
|
162
161
|
var PENDING2 = /* @__PURE__ */ new WeakMap();
|
|
163
162
|
var PARENT = /* @__PURE__ */ new WeakMap();
|
|
164
163
|
var METHOD = /* @__PURE__ */ new WeakMap();
|
|
164
|
+
var EXPORT;
|
|
165
165
|
var define = Object.defineProperty;
|
|
166
166
|
var Model = class _Model {
|
|
167
167
|
constructor(...args) {
|
|
@@ -574,7 +574,10 @@ function use(arg1, arg2) {
|
|
|
574
574
|
if (Model.is(arg1)) {
|
|
575
575
|
const type = arg1;
|
|
576
576
|
arg1 = (key2, subject) => {
|
|
577
|
-
const
|
|
577
|
+
const value = new type();
|
|
578
|
+
const desc = { set: set2 };
|
|
579
|
+
set2(value);
|
|
580
|
+
PARENT.set(value, subject);
|
|
578
581
|
function set2(next) {
|
|
579
582
|
if (next ? !(next instanceof type) : arg2 !== false)
|
|
580
583
|
throw new Error(`${subject}.${key2} expected Model of type ${type} but got ${next && next.constructor}.`);
|
|
@@ -583,11 +586,6 @@ function use(arg1, arg2) {
|
|
|
583
586
|
arg2(next);
|
|
584
587
|
return false;
|
|
585
588
|
}
|
|
586
|
-
function get2() {
|
|
587
|
-
set2(new type());
|
|
588
|
-
desc.get = arg2 !== false;
|
|
589
|
-
return fetch(subject, key2);
|
|
590
|
-
}
|
|
591
589
|
return desc;
|
|
592
590
|
};
|
|
593
591
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -121,13 +121,13 @@ function effect(target, callback, requireValues) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// src/model.ts
|
|
124
|
-
var EXPORT;
|
|
125
124
|
var NAMES = /* @__PURE__ */ new WeakMap();
|
|
126
125
|
var STATE = /* @__PURE__ */ new WeakMap();
|
|
127
126
|
var NOTIFY = /* @__PURE__ */ new WeakMap();
|
|
128
127
|
var PENDING2 = /* @__PURE__ */ new WeakMap();
|
|
129
128
|
var PARENT = /* @__PURE__ */ new WeakMap();
|
|
130
129
|
var METHOD = /* @__PURE__ */ new WeakMap();
|
|
130
|
+
var EXPORT;
|
|
131
131
|
var define = Object.defineProperty;
|
|
132
132
|
var Model = class _Model {
|
|
133
133
|
constructor(...args) {
|
|
@@ -540,7 +540,10 @@ function use(arg1, arg2) {
|
|
|
540
540
|
if (Model.is(arg1)) {
|
|
541
541
|
const type = arg1;
|
|
542
542
|
arg1 = (key2, subject) => {
|
|
543
|
-
const
|
|
543
|
+
const value = new type();
|
|
544
|
+
const desc = { set: set2 };
|
|
545
|
+
set2(value);
|
|
546
|
+
PARENT.set(value, subject);
|
|
544
547
|
function set2(next) {
|
|
545
548
|
if (next ? !(next instanceof type) : arg2 !== false)
|
|
546
549
|
throw new Error(`${subject}.${key2} expected Model of type ${type} but got ${next && next.constructor}.`);
|
|
@@ -549,11 +552,6 @@ function use(arg1, arg2) {
|
|
|
549
552
|
arg2(next);
|
|
550
553
|
return false;
|
|
551
554
|
}
|
|
552
|
-
function get2() {
|
|
553
|
-
set2(new type());
|
|
554
|
-
desc.get = arg2 !== false;
|
|
555
|
-
return fetch(subject, key2);
|
|
556
|
-
}
|
|
557
555
|
return desc;
|
|
558
556
|
};
|
|
559
557
|
}
|
package/package.json
CHANGED