reactronic 0.22.508 → 0.22.510
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.
|
@@ -4,6 +4,13 @@ export declare type BoolOnly<T> = Pick<T, {
|
|
|
4
4
|
export declare type GivenTypeOnly<T, V> = Pick<T, {
|
|
5
5
|
[P in keyof T]: T[P] extends V ? P : never;
|
|
6
6
|
}[keyof T]>;
|
|
7
|
+
declare global {
|
|
8
|
+
interface T extends Object {
|
|
9
|
+
$$: {
|
|
10
|
+
readonly [P in keyof T]-?: Ref<T[P]>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
7
14
|
export declare function refs<O extends object = object>(owner: O): {
|
|
8
15
|
readonly [P in keyof O]-?: Ref<O[P]>;
|
|
9
16
|
};
|
package/build/dist/source/Ref.js
CHANGED
|
@@ -83,3 +83,9 @@ class CustomToggleRefGettingProxy {
|
|
|
83
83
|
return new ToggleRef(obj, prop, this.value1, this.value2);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
Object.defineProperty(Object.prototype, '$$', {
|
|
87
|
+
configurable: false, enumerable: false,
|
|
88
|
+
get() {
|
|
89
|
+
return new Proxy(this, RefGettingProxy);
|
|
90
|
+
},
|
|
91
|
+
});
|
|
@@ -458,7 +458,7 @@ class Operation extends Observable {
|
|
|
458
458
|
ctx.bumpBy(os.changeset.timestamp);
|
|
459
459
|
const t = weak ? -1 : ctx.timestamp;
|
|
460
460
|
if (!op.subscribeTo(observable, os, m, h, t))
|
|
461
|
-
op.markObsoleteDueTo(observable, m,
|
|
461
|
+
op.markObsoleteDueTo(observable, m, h.head.changeset, h, BOOT_CAUSE, ctx.timestamp, ctx.reactive);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
}
|
|
@@ -589,7 +589,7 @@ class Operation extends Observable {
|
|
|
589
589
|
return ok;
|
|
590
590
|
}
|
|
591
591
|
static canSubscribe(observable, os, m, h, timestamp) {
|
|
592
|
-
let result =
|
|
592
|
+
let result = observable === h.head.data[m] || os.former.snapshot == h.head;
|
|
593
593
|
if (result && timestamp !== -1)
|
|
594
594
|
result = !(observable instanceof Operation && timestamp >= observable.obsoleteSince);
|
|
595
595
|
return result;
|