@dynein/hyperfor
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@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)
		})
	})
})

Readme

Keywords

none

Package Sidebar

Install

npm i @dynein/hyperfor

Weekly Downloads

1

Version

0.5.0

License

MIT

Unpacked Size

27.7 kB

Total Files

10

Last publish

Collaborators

  • kerwizzy