Reactive-lite

Simplified yet powerful reactive component

View project on GitHub

Reuse config

Reuse config is used for high level component (like list, grid) to make the rendering process extremely fast.

Generate config

Reusable config could be generated by Reactive.generateConfig(), it's a static method which have the same arguments as reactive constructor, the difference is it would not make any change on dom or anything else, instead, it return an array of config object.

The config object have two properties, one is indexes for a node which have reactive binding(s), the other property contains a list of binding functions.

Use config

Config object is set by option object, like:

  new Reactive(el, model, {delegate: delegate, config: config})

Reactive would find each element with binding by something like:

  this.el.childNodes[0].childNodes[1].childNodes[2]

And apply the bindings (just functions) by binding.active(el) method, everything just works, no element parse and function generate any more.

There are lots of test added to make sure binding function is reusable

List and Grid

The component list and exgrid is working in progress to make use of reactive-lite.