vdom-thunk

3.0.0 • Public • Published

vdom-thunk

A thunk optimization for virtual-dom

Example

Use partial when you want to avoid re-rendering subtrees.

partial will only re-evaluate the subtree if the arguments you pass to it change. This means you should use an immutable data structure (like observ-struct)

var partial = require("vdom-thunk")
 
function render(state) {
  return h('div', [
    partial(header, state.head),
    main(),
    partial(footer, state.foot)
  ])
}
 
function header(head) { ... }
function main() { ... }
function footer(foot) { ... }

Installation

npm install vdom-thunk

Contributors

  • Raynos

MIT Licenced

Readme

Keywords

none

Package Sidebar

Install

npm i vdom-thunk

Weekly Downloads

292

Version

3.0.0

License

none

Last publish

Collaborators

  • raynos