@dynein/hyperfor
v0.5.1
Published
Adds high-performance loop/list rendering to [Dynein](https://www.npmjs.com/package/dynein).
Downloads
4
Readme
@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)
})
})
})