Skip to content

Commit

Permalink
Fix ts
Browse files Browse the repository at this point in the history
  • Loading branch information
wrnrlr committed Oct 24, 2024
1 parent 0b2b5ae commit 4a3fed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/controlflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type ItemHolder = {

export type ListProps<T> = {
when: T,
each: any,
children: Child | ((a:()=>T)=>void),
fallback: unknown
}
Expand All @@ -44,7 +45,7 @@ List
export function List<T>(props:ListProps<T>) {
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,
Expand Down
2 changes: 1 addition & 1 deletion src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a3fed5

Please sign in to comment.