reactronic 0.24.260 → 0.24.261
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 child<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;
|
|
@@ -69,9 +69,10 @@ export type RxNodeDriver<E = unknown> = {
|
|
|
69
69
|
readonly predefine?: SimpleDelegate<E>;
|
|
70
70
|
allocate(node: RxNode<E>): E;
|
|
71
71
|
create(node: RxNode<E>): void;
|
|
72
|
+
destroy(node: RxNode<E>, isLeader: boolean): boolean;
|
|
72
73
|
mount(node: RxNode<E>): void;
|
|
73
74
|
update(node: RxNode<E>): void | Promise<void>;
|
|
74
|
-
|
|
75
|
+
child(driver: RxNodeDriver<any>, declaration?: RxNodeDecl<any>, preset?: RxNodeDecl<any>): void;
|
|
75
76
|
};
|
|
76
77
|
export type RxNodeContext<T extends Object = Object> = {
|
|
77
78
|
value: T;
|
|
@@ -83,9 +84,10 @@ export declare abstract class BaseDriver<E = unknown> implements RxNodeDriver<E>
|
|
|
83
84
|
constructor(name: string, isPartitionSeparator: boolean, predefine?: SimpleDelegate<E, void> | undefined);
|
|
84
85
|
abstract allocate(node: RxNode<E>): E;
|
|
85
86
|
create(node: RxNode<E>): void;
|
|
87
|
+
destroy(node: RxNode<E>, isLeader: boolean): boolean;
|
|
86
88
|
mount(node: RxNode<E>): void;
|
|
87
89
|
update(node: RxNode<E>): void | Promise<void>;
|
|
88
|
-
|
|
90
|
+
child(driver: RxNodeDriver<any>, declaration?: RxNodeDecl<any>, preset?: RxNodeDecl<any>): void;
|
|
89
91
|
}
|
|
90
92
|
export declare class RxNodeVariable<T extends Object = Object> {
|
|
91
93
|
readonly defaultValue: T | undefined;
|
|
@@ -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 child(driver, declaration, preset) {
|
|
39
39
|
var _a;
|
|
40
40
|
let result;
|
|
41
41
|
if (declaration)
|
|
@@ -45,6 +45,7 @@ export class RxNode {
|
|
|
45
45
|
let key = declaration.key;
|
|
46
46
|
const owner = gOwnSeat === null || gOwnSeat === void 0 ? void 0 : gOwnSeat.instance;
|
|
47
47
|
if (owner) {
|
|
48
|
+
owner.driver.child(driver, declaration, preset);
|
|
48
49
|
let existing = undefined;
|
|
49
50
|
const children = owner.children;
|
|
50
51
|
if (driver.isPartitionSeparator) {
|
|
@@ -160,14 +161,16 @@ export class BaseDriver {
|
|
|
160
161
|
(_a = this.predefine) === null || _a === void 0 ? void 0 : _a.call(this, node.element);
|
|
161
162
|
invokeOnCreateViaPresetChain(node.element, node.declaration);
|
|
162
163
|
}
|
|
164
|
+
destroy(node, isLeader) {
|
|
165
|
+
invokeOnDestroyViaPresetChain(node.element, node.declaration);
|
|
166
|
+
return isLeader;
|
|
167
|
+
}
|
|
163
168
|
mount(node) {
|
|
164
169
|
}
|
|
165
170
|
update(node) {
|
|
166
171
|
invokeOnChangeViaPresetChain(node.element, node.declaration);
|
|
167
172
|
}
|
|
168
|
-
|
|
169
|
-
invokeOnDestroyViaPresetChain(node.element, node.declaration);
|
|
170
|
-
return isLeader;
|
|
173
|
+
child(driver, declaration, preset) {
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
export class RxNodeVariable {
|