diff --git a/src/controlflow.ts b/src/controlflow.ts index 3449d4d..a21766e 100644 --- a/src/controlflow.ts +++ b/src/controlflow.ts @@ -33,6 +33,7 @@ type ItemHolder = { export type ListProps = { when: T, + each: any, children: Child | ((a:()=>T)=>void), fallback: unknown } @@ -44,7 +45,7 @@ List export function List(props:ListProps) { const fallback = "fallback" in props && { fallback: () => props.fallback } const list = props.each - const cb:any = props.children.call ? props.children : (v)=>v + const cb:any = (props.children as any)?.call ? props.children : (v:any)=>v let items:ItemHolder[] = [], item: undefined|ItemHolder, // unusedItems, diff --git a/src/mod.ts b/src/mod.ts index da6f934..762ed78 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -11,7 +11,7 @@ export {resource,makeAbortable,abortable} from './resource.js' // export {Input,Table} from './components.js' // export * from './canvas.js' -const r:Runtime|undefined = /*#__PURE__*/ (typeof window === 'object') ? runtime(window) : undefined +const r:Runtime|undefined = /*#__PURE__*/ (typeof window === 'object') ? runtime(window as any) : undefined /** h @example Element with a single child