viewnode

1.3.0 • Public • Published

viewnode

simple view engine, load once, render many times

demo

reference

<tag component="component" id?="id">
  if id exists, viewMap[id] will be available
</tag>
type ViewNode {
  node: HTMLElement
  name: string
}

type ViewMap {
  [key: string]: ViewNode
}

fn RenderOnceFunction(
    el: ViewNode,
    context: Object,
    render: RenderFunction,
    viewMap: ViewMap,
) -> UnloadFunction

fn RenderMultipleFunction(
    el: ViewNode,
    context: Object,
    render: RenderFunction,
    viewMap: ViewMap,
) -> ()

type ComponentMap {
  [name: string]: RenderOnceFunction | RenderMultipleFunction
}

fn LoadFunction() -> ()
fn RenderFunction() -> ()
fn UnloadFunction() -> ()

type App {
    load: LoadFunction,
    render: RenderFunction, 
    unload: UnloadFunction,
}

license

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i viewnode

Weekly Downloads

0

Version

1.3.0

License

ISC

Unpacked Size

5.35 kB

Total Files

4

Last publish

Collaborators

  • fanlia