reactronic 0.24.262 → 0.24.264
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.
|
@@ -35,7 +35,7 @@ export declare abstract class RxNode<E = unknown> {
|
|
|
35
35
|
static readonly longFrameDuration = 300;
|
|
36
36
|
static currentUpdatePriority: Priority;
|
|
37
37
|
static frameDuration: number;
|
|
38
|
-
static
|
|
38
|
+
static declare<E = void>(driver: RxNodeDriver<E>, declaration?: RxNodeDecl<E>, preset?: RxNodeDecl<E>): RxNode<E>;
|
|
39
39
|
static get isFirstUpdate(): boolean;
|
|
40
40
|
static get key(): string;
|
|
41
41
|
static get stamp(): number;
|
|
@@ -65,7 +65,7 @@ export type RxNodeDecl<E = unknown> = {
|
|
|
65
65
|
};
|
|
66
66
|
export type RxNodeDriver<E = unknown> = {
|
|
67
67
|
readonly name: string;
|
|
68
|
-
readonly
|
|
68
|
+
readonly isPartition: boolean;
|
|
69
69
|
readonly predefine?: SimpleDelegate<E>;
|
|
70
70
|
allocate(node: RxNode<E>): E;
|
|
71
71
|
create(node: RxNode<E>): void;
|
|
@@ -79,9 +79,9 @@ export type RxNodeContext<T extends Object = Object> = {
|
|
|
79
79
|
};
|
|
80
80
|
export declare abstract class BaseDriver<E = unknown> implements RxNodeDriver<E> {
|
|
81
81
|
readonly name: string;
|
|
82
|
-
readonly
|
|
82
|
+
readonly isPartition: boolean;
|
|
83
83
|
readonly predefine?: SimpleDelegate<E, void> | undefined;
|
|
84
|
-
constructor(name: string,
|
|
84
|
+
constructor(name: string, isPartition: boolean, predefine?: SimpleDelegate<E, void> | undefined);
|
|
85
85
|
abstract allocate(node: RxNode<E>): E;
|
|
86
86
|
create(node: RxNode<E>): void;
|
|
87
87
|
destroy(node: RxNode<E>, isLeader: boolean): boolean;
|
|
@@ -35,7 +35,7 @@ export var Priority;
|
|
|
35
35
|
Priority[Priority["background"] = 2] = "background";
|
|
36
36
|
})(Priority || (Priority = {}));
|
|
37
37
|
export class RxNode {
|
|
38
|
-
static
|
|
38
|
+
static declare(driver, declaration, preset) {
|
|
39
39
|
var _a;
|
|
40
40
|
let result;
|
|
41
41
|
if (declaration)
|
|
@@ -48,7 +48,7 @@ export class RxNode {
|
|
|
48
48
|
owner.driver.child(owner, driver, declaration, preset);
|
|
49
49
|
let existing = undefined;
|
|
50
50
|
const children = owner.children;
|
|
51
|
-
if (driver.
|
|
51
|
+
if (driver.isPartition) {
|
|
52
52
|
const last = children.lastMergedItem();
|
|
53
53
|
if (((_a = last === null || last === void 0 ? void 0 : last.instance) === null || _a === void 0 ? void 0 : _a.driver) === driver)
|
|
54
54
|
existing = last;
|
|
@@ -151,9 +151,9 @@ RxNode.longFrameDuration = 300;
|
|
|
151
151
|
RxNode.currentUpdatePriority = Priority.realtime;
|
|
152
152
|
RxNode.frameDuration = RxNode.longFrameDuration;
|
|
153
153
|
export class BaseDriver {
|
|
154
|
-
constructor(name,
|
|
154
|
+
constructor(name, isPartition, predefine) {
|
|
155
155
|
this.name = name;
|
|
156
|
-
this.
|
|
156
|
+
this.isPartition = isPartition;
|
|
157
157
|
this.predefine = predefine;
|
|
158
158
|
}
|
|
159
159
|
create(node) {
|
|
@@ -368,7 +368,7 @@ function runUpdateNestedNodesThenDo(error, action) {
|
|
|
368
368
|
if (Transaction.isCanceled)
|
|
369
369
|
break;
|
|
370
370
|
const childNode = child.instance;
|
|
371
|
-
const isPart = childNode.driver.
|
|
371
|
+
const isPart = childNode.driver.isPartition;
|
|
372
372
|
const host = isPart ? owner : partition;
|
|
373
373
|
const p = (_a = childNode.priority) !== null && _a !== void 0 ? _a : Priority.realtime;
|
|
374
374
|
mounting = markToMountIfNecessary(mounting, host, child, children, sequential);
|
|
@@ -510,7 +510,7 @@ function triggerDeactivation(seat, isLeader, individual) {
|
|
|
510
510
|
const node = seat.instance;
|
|
511
511
|
if (node.stamp >= 0) {
|
|
512
512
|
const driver = node.driver;
|
|
513
|
-
if (individual && node.key !== node.declaration.key && !driver.
|
|
513
|
+
if (individual && node.key !== node.declaration.key && !driver.isPartition)
|
|
514
514
|
console.log(`WARNING: it is recommended to assign explicit key for conditional element in order to avoid unexpected side effects: ${node.key}`);
|
|
515
515
|
node.stamp = ~node.stamp;
|
|
516
516
|
const childrenAreLeaders = unobs(() => driver.destroy(node, isLeader));
|