Skip to content

Commit

Permalink
0.0.884
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Feb 15, 2025
1 parent 7cb013c commit 2ee5568
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions trHelpers/onMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion trHelpers/onMount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ export async function onMount<TProps extends {}, TMethods = TProps, TElement = {
const {type, name} = first;
if(type === '$'){
const {model} = transformer;
const subModel = (<any>model)[name]
const subModel = (<any>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;
Expand Down

0 comments on commit 2ee5568

Please sign in to comment.