async function onMatch(
def: Placeholder,
match: ReturnType<ReturnType<typeof useMatch>>,
prevMatch: typeof match
) {
// <...>
const els = children(() => (
<AdvancedRouterContext.Provider value={{ ...ctx, match }}>
<def.component />
</AdvancedRouterContext.Provider>
))
const promise = new Promise<HTMLElement>(res => {
createComputed(() => {
const el = els.toArray()[0]
if (el === undefined) return
res(el as HTMLElement)
})
})
const element = await promise
view = {
stackable: def.stackable,
next: null,
parent: store.top,
path: match.path,
element
}
batch(() => {
store.graph.push(view as View)
store.top = view
})
// <...>
}
async function onMatch(
def: Placeholder,
match: ReturnType<ReturnType<typeof useMatch>>,
prevMatch: typeof match
) {
// <...>
const els = children(() => (
<AdvancedRouterContext.Provider value={{ ...ctx, match }}>
<def.component />
</AdvancedRouterContext.Provider>
))
const promise = new Promise<HTMLElement>(res => {
createComputed(() => {
const el = els.toArray()[0]
if (el === undefined) return
res(el as HTMLElement)
})
})
const element = await promise
view = {
stackable: def.stackable,
next: null,
parent: store.top,
path: match.path,
element
}
batch(() => {
store.graph.push(view as View)
store.top = view
})
// <...>
}