0.5.0 • Published 9 months ago
@dynein/hyperfor v0.5.0
@dynein/hyperfor
Adds high-performance loop/list rendering to Dynein.
Usage
function hyperfor<T>(arr: WatchedArray<T>, render: (item: T, index: ()=>number) => void): void
Example
import hyperfor from "@dynein/hyperfor"
import * as D from "dynein"
import { WatchedArray } from "@dynein/watched-builtins"
const arr = new WatchedArray([1,2,3])
D.createRoot(()=>{
D.mountBody(()=>{
hyperfor(arr, (item) => {
D.addText(item)
})
})
})