reactronic 0.24.271 → 0.24.273
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.
|
@@ -55,11 +55,11 @@ export declare abstract class RxNode<E = unknown> {
|
|
|
55
55
|
static setDefaultLoggingOptions(logging?: LoggingOptions): void;
|
|
56
56
|
}
|
|
57
57
|
export type RxNodeDecl<E = unknown> = {
|
|
58
|
-
|
|
58
|
+
script?: Delegate<E>;
|
|
59
59
|
key?: string;
|
|
60
60
|
mode?: Mode;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
creation?: Delegate<E>;
|
|
62
|
+
destruction?: Delegate<E>;
|
|
63
63
|
triggers?: unknown;
|
|
64
64
|
preset?: RxNodeDecl<E>;
|
|
65
65
|
};
|
|
@@ -161,7 +161,7 @@ export class BaseDriver {
|
|
|
161
161
|
mount(node) {
|
|
162
162
|
}
|
|
163
163
|
update(node) {
|
|
164
|
-
|
|
164
|
+
invokeScriptViaPresetChain(node.element, node.declaration);
|
|
165
165
|
}
|
|
166
166
|
child(ownerNode, childDriver, childDeclaration, childPreset) {
|
|
167
167
|
return undefined;
|
|
@@ -197,25 +197,25 @@ function getModeViaPresetChain(declaration) {
|
|
|
197
197
|
}
|
|
198
198
|
function invokeOnCreateViaPresetChain(element, declaration) {
|
|
199
199
|
const preset = declaration.preset;
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
|
|
200
|
+
const creation = declaration.creation;
|
|
201
|
+
if (creation)
|
|
202
|
+
creation(element, preset ? () => invokeOnCreateViaPresetChain(element, preset) : NOP);
|
|
203
203
|
else if (preset)
|
|
204
204
|
invokeOnCreateViaPresetChain(element, preset);
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function invokeScriptViaPresetChain(element, declaration) {
|
|
207
207
|
const preset = declaration.preset;
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
|
|
208
|
+
const script = declaration.script;
|
|
209
|
+
if (script)
|
|
210
|
+
script(element, preset ? () => invokeScriptViaPresetChain(element, preset) : NOP);
|
|
211
211
|
else if (preset)
|
|
212
|
-
|
|
212
|
+
invokeScriptViaPresetChain(element, preset);
|
|
213
213
|
}
|
|
214
214
|
function invokeOnDestroyViaPresetChain(element, declaration) {
|
|
215
215
|
const preset = declaration.preset;
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
|
|
216
|
+
const destruction = declaration.destruction;
|
|
217
|
+
if (destruction)
|
|
218
|
+
destruction(element, preset ? () => invokeOnDestroyViaPresetChain(element, preset) : NOP);
|
|
219
219
|
else if (preset)
|
|
220
220
|
invokeOnDestroyViaPresetChain(element, preset);
|
|
221
221
|
}
|