Inc DOM(Demoed in CirruScript and Todolist)
Demo:
Usage
Also a small wrapper on [incremental-dom][http://google.github.io/incremental-dom] API.
npm i --save inc-dom
IncDOM = require 'inc-dom' = console.log :event IncDOMbr = IncDOMcreateFactory 'br' data = # which changes IncDOMrender documentbody-> IncDOMdiv key: 'keyed'style: color: 'red'onclick: onclick-> IncDOMdiv nullstyle: width: "px"-> br IncDOMtext
patch
:IncrementalDOM.patch
text
:IncrementalDOM.patch
createFactory
:(tagName) -> (staticAttrs, properties, cb) -> undefined
createElement
:(tagName, staticAttrs, properties, cb) -> undefined
div
:createFactory('div')
span
:createFactory('span')
Read demo code in src/app/page
for details.
incremental-dom
API
On -
incremental-dom
API useskey
for elements in an array.inc-dom
putskey
instaticAttrs
, which is like in React. -
when called with 1 less arguments,
properties
will be omitted. -
the difference between
staticAttrs
andproperties
is the name asincremental-dom
.staticAttrs
will not change after setting on DOM,properties
will. -
cb
is a function to ensure the excution order or children elements.
This package is expertimental. Extend it if you want to create components.
Wallpaper
Credit http://img.wallpapergang.com/139processed/Creative House Stair Design HD wallpaper.jpg
Usage
- Development
npm igulp htmlwebpack-dev-server --hot
- Production
gulp buldgulp rsync
License
MIT