@expressive/mvc 0.7.0 → 0.7.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/lib/index.d.ts +14 -2
- package/lib/index.esm.js +14 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +14 -8
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -806,18 +806,24 @@ function get(arg0, arg1, arg2) {
|
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
function ref(arg) {
|
|
809
|
+
function ref(arg, mapper) {
|
|
810
810
|
return apply(function ref(key) {
|
|
811
811
|
let value = {};
|
|
812
|
-
if (typeof arg
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
812
|
+
if (typeof arg != "object")
|
|
813
|
+
value = createRef(this, key, arg);
|
|
814
|
+
else
|
|
815
|
+
ensure(arg).state.forEach((_val, key) => {
|
|
816
|
+
defineProperty(value, key, mapper ? {
|
|
817
|
+
configurable: true,
|
|
818
|
+
get() {
|
|
819
|
+
const out = mapper(key);
|
|
820
|
+
defineProperty(value, key, { value: out });
|
|
821
|
+
return out;
|
|
822
|
+
}
|
|
823
|
+
} : {
|
|
816
824
|
value: createRef(this, key)
|
|
817
825
|
});
|
|
818
|
-
|
|
819
|
-
else
|
|
820
|
-
value = createRef(this, key, arg);
|
|
826
|
+
});
|
|
821
827
|
return { value, explicit: true };
|
|
822
828
|
});
|
|
823
829
|
}
|