reactronic 0.24.119 → 0.24.120
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.
|
@@ -37,7 +37,13 @@ export declare abstract class RxNode<E = unknown> {
|
|
|
37
37
|
static frameDuration: number;
|
|
38
38
|
static acquire<E = void>(driver: RxNodeDriver<E>, declaration?: RxNodeDecl<E>, preset?: RxNodeDecl<E>): RxNode<E>;
|
|
39
39
|
static get isFirstUpdate(): boolean;
|
|
40
|
-
static get
|
|
40
|
+
static get key(): string;
|
|
41
|
+
static get stamp(): number;
|
|
42
|
+
static get triggers(): unknown;
|
|
43
|
+
static get priority(): Priority;
|
|
44
|
+
static set priority(value: Priority);
|
|
45
|
+
static get childrenShuffling(): boolean;
|
|
46
|
+
static set childrenShuffling(value: boolean);
|
|
41
47
|
static triggerUpdate(node: RxNode<any>, triggers: unknown): void;
|
|
42
48
|
static updateNestedNodesThenDo(action: (error: unknown) => void): void;
|
|
43
49
|
static findMatchingHost<E = unknown, R = unknown>(node: RxNode<E>, match: SimpleDelegate<RxNode<E>, boolean>): RxNode<R> | undefined;
|
|
@@ -43,7 +43,7 @@ export class RxNode {
|
|
|
43
43
|
else
|
|
44
44
|
declaration = preset !== null && preset !== void 0 ? preset : {};
|
|
45
45
|
let key = declaration.key;
|
|
46
|
-
const owner =
|
|
46
|
+
const owner = gOwnSeat === null || gOwnSeat === void 0 ? void 0 : gOwnSeat.instance;
|
|
47
47
|
if (owner) {
|
|
48
48
|
let existing = undefined;
|
|
49
49
|
const children = owner.children;
|
|
@@ -75,11 +75,28 @@ export class RxNode {
|
|
|
75
75
|
return result;
|
|
76
76
|
}
|
|
77
77
|
static get isFirstUpdate() {
|
|
78
|
-
return
|
|
78
|
+
return RxNodeImpl.ownSeat.instance.stamp === 1;
|
|
79
79
|
}
|
|
80
|
-
static get
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
static get key() {
|
|
81
|
+
return RxNodeImpl.ownSeat.instance.key;
|
|
82
|
+
}
|
|
83
|
+
static get stamp() {
|
|
84
|
+
return RxNodeImpl.ownSeat.instance.stamp;
|
|
85
|
+
}
|
|
86
|
+
static get triggers() {
|
|
87
|
+
return RxNodeImpl.ownSeat.instance.declaration.triggers;
|
|
88
|
+
}
|
|
89
|
+
static get priority() {
|
|
90
|
+
return RxNodeImpl.ownSeat.instance.priority;
|
|
91
|
+
}
|
|
92
|
+
static set priority(value) {
|
|
93
|
+
RxNodeImpl.ownSeat.instance.priority = value;
|
|
94
|
+
}
|
|
95
|
+
static get childrenShuffling() {
|
|
96
|
+
return RxNodeImpl.ownSeat.instance.childrenShuffling;
|
|
97
|
+
}
|
|
98
|
+
static set childrenShuffling(value) {
|
|
99
|
+
RxNodeImpl.ownSeat.instance.childrenShuffling = value;
|
|
83
100
|
}
|
|
84
101
|
static triggerUpdate(node, triggers) {
|
|
85
102
|
const impl = node;
|
|
@@ -254,14 +271,14 @@ class RxNodeImpl extends RxNode {
|
|
|
254
271
|
throw new Error('reactronic can be configured only for elements with independent update mode and only inside initialize');
|
|
255
272
|
return RxSystem.getReaction(this.update).configure(options);
|
|
256
273
|
}
|
|
257
|
-
static get
|
|
258
|
-
if (!
|
|
274
|
+
static get ownSeat() {
|
|
275
|
+
if (!gOwnSeat)
|
|
259
276
|
throw new Error('current element is undefined');
|
|
260
|
-
return
|
|
277
|
+
return gOwnSeat;
|
|
261
278
|
}
|
|
262
279
|
static tryUseNodeVariableValue(variable) {
|
|
263
280
|
var _a, _b;
|
|
264
|
-
let node = RxNodeImpl.
|
|
281
|
+
let node = RxNodeImpl.ownSeat.instance;
|
|
265
282
|
while (((_a = node.context) === null || _a === void 0 ? void 0 : _a.variable) !== variable && node.owner !== node)
|
|
266
283
|
node = node.outer.seat.instance;
|
|
267
284
|
return (_b = node.context) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -274,7 +291,7 @@ class RxNodeImpl extends RxNode {
|
|
|
274
291
|
return result;
|
|
275
292
|
}
|
|
276
293
|
static setNodeVariableValue(variable, value) {
|
|
277
|
-
const node = RxNodeImpl.
|
|
294
|
+
const node = RxNodeImpl.ownSeat.instance;
|
|
278
295
|
const owner = node.owner;
|
|
279
296
|
const hostCtx = unobs(() => { var _a; return (_a = owner.context) === null || _a === void 0 ? void 0 : _a.value; });
|
|
280
297
|
if (value && value !== hostCtx) {
|
|
@@ -317,8 +334,8 @@ function getNodeKey(node) {
|
|
|
317
334
|
}
|
|
318
335
|
function runUpdateNestedNodesThenDo(error, action) {
|
|
319
336
|
var _a;
|
|
320
|
-
const
|
|
321
|
-
const owner =
|
|
337
|
+
const ownSeat = RxNodeImpl.ownSeat;
|
|
338
|
+
const owner = ownSeat.instance;
|
|
322
339
|
const children = owner.children;
|
|
323
340
|
if (children.isMergeInProgress) {
|
|
324
341
|
let promised = undefined;
|
|
@@ -350,7 +367,7 @@ function runUpdateNestedNodesThenDo(error, action) {
|
|
|
350
367
|
partition = childNode;
|
|
351
368
|
}
|
|
352
369
|
if (!Transaction.isCanceled && (p1 !== undefined || p2 !== undefined))
|
|
353
|
-
promised = startIncrementalUpdate(
|
|
370
|
+
promised = startIncrementalUpdate(ownSeat, children, p1, p2).then(() => action(error), e => action(e));
|
|
354
371
|
}
|
|
355
372
|
}
|
|
356
373
|
finally {
|
|
@@ -516,23 +533,23 @@ function runDisposalLoop() {
|
|
|
516
533
|
}
|
|
517
534
|
function wrapToRunInside(func) {
|
|
518
535
|
let wrappedToRunInside;
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
536
|
+
const outer = gOwnSeat;
|
|
537
|
+
if (outer)
|
|
521
538
|
wrappedToRunInside = (...args) => {
|
|
522
|
-
return runInside(
|
|
539
|
+
return runInside(outer, func, ...args);
|
|
523
540
|
};
|
|
524
541
|
else
|
|
525
542
|
wrappedToRunInside = func;
|
|
526
543
|
return wrappedToRunInside;
|
|
527
544
|
}
|
|
528
545
|
function runInside(seat, func, ...args) {
|
|
529
|
-
const outer =
|
|
546
|
+
const outer = gOwnSeat;
|
|
530
547
|
try {
|
|
531
|
-
|
|
548
|
+
gOwnSeat = seat;
|
|
532
549
|
return func(...args);
|
|
533
550
|
}
|
|
534
551
|
finally {
|
|
535
|
-
|
|
552
|
+
gOwnSeat = outer;
|
|
536
553
|
}
|
|
537
554
|
}
|
|
538
555
|
function triggersAreEqual(a1, a2) {
|
|
@@ -585,6 +602,6 @@ function defaultReject(error) {
|
|
|
585
602
|
}
|
|
586
603
|
Promise.prototype.then = reactronicDomHookedThen;
|
|
587
604
|
const NOP = (...args) => { };
|
|
588
|
-
let
|
|
605
|
+
let gOwnSeat = undefined;
|
|
589
606
|
let gFirstToDispose = undefined;
|
|
590
607
|
let gLastToDispose = undefined;
|