0.13.2 • Published 11 years ago

reactive-component v0.13.2

Weekly downloads
122
License
-
Repository
-
Last release
11 years ago

reactive

Reactive template engine

Installation

$ component install component/reactive

Example

Simply invoke reactive() on the element to wish to become the "template" for obj. The given obj must emit "change" events passing (prop, val), the template will react to these changes.

var reactive = require('reactive');
reactive(el, obj);

You may also map custom callbacks for formatting or messing with an element based on a change. The element, value, and object itself are passed as arguments.

var reactive = require('reactive');
reactive(el, user, {
  birthdate: function(el, date, user){
    el.textContent = date.getFullYear() + '/' + date.getMonth() + '/' + date.getDate();
  }
});

Todo

  • composition of smaller templates instead of conditionals etc..
  • defer .render() and use .change('birthdate', fn) instead of object-literal
  • moar docs / examples

License

MIT

0.13.2

11 years ago

0.13.1

11 years ago

0.13.0

11 years ago

0.12.3

11 years ago

0.12.2

11 years ago

0.12.1

11 years ago

0.12.0

11 years ago

0.11.0

11 years ago

0.10.1

11 years ago

0.10.0

11 years ago

0.9.0

11 years ago

0.8.0

11 years ago

0.7.1

11 years ago

0.7.0

11 years ago

0.6.1

11 years ago

0.6.0

11 years ago

0.5.0

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago