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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.3.00
1.2.10
1.2.00
1.1.10
1.1.00
1.0.00

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