From 2ee5568621d1f6ad061f85a360b231f599d467d3 Mon Sep 17 00:00:00 2001 From: "Bruce B. Anderson" Date: Sat, 15 Feb 2025 12:09:00 -0500 Subject: [PATCH] 0.0.884 --- trHelpers/onMount.js | 6 ++++++ trHelpers/onMount.ts | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/trHelpers/onMount.js b/trHelpers/onMount.js index 972b68d6..fa2e7f93 100644 --- a/trHelpers/onMount.js +++ b/trHelpers/onMount.js @@ -9,6 +9,12 @@ export async function onMount(transformer, mo, matchingElement, uows, skipInit, if (type === '$') { const { model } = transformer; const subModel = model[name]; + if (subModel === undefined) { + model.propagator.addEventListener(name, e => { + onMount(transformer, mo, matchingElement, uows, skipInit, ctx, matchingElements, observer, mountObserver); + }, { once: true }); + return; + } if (Array.isArray(subModel)) { const { ForEachImpl, forEachImpls } = await import('./ForEachImpl.js'); let forEachImpl; diff --git a/trHelpers/onMount.ts b/trHelpers/onMount.ts index f2ac1355..f0d60124 100644 --- a/trHelpers/onMount.ts +++ b/trHelpers/onMount.ts @@ -17,7 +17,13 @@ export async function onMountmodel)[name] + const subModel = (model)[name]; + if(subModel === undefined) { + model.propagator.addEventListener(name, e => { + onMount(transformer, mo, matchingElement, uows, skipInit, ctx, matchingElements, observer, mountObserver); + }, {once: true}) + return; + } if(Array.isArray(subModel)){ const {ForEachImpl, forEachImpls} = await import('./ForEachImpl.js'); let forEachImpl: ForEachInterface | undefined;