No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
package.json
readme.md
tincture.js

readme.md

Tincture

bind to the inputs/outputs of a dom branch

Install

npm install tincture

Use

<div id="calculator">
  <p>
    width: <input type="text" name="width" data-type="float" />
  </p>
  <p>
    height: <input type="text" name="height" data-type="float" />
  </p>
  <p>
    Area: <span data-output="area"></span>
  </p>
</div>
var tincture = require('tincture');

var component = tincture(document.getElementById('calculator'));

component.compute(['width', 'height'], function(width, height) {
  this.area(width * height);
});

component.width.change(function(val, prev) {
  console.log('width just changed from', prev, 'to', val);
});

To see this example in action visit the examples directory

data-types

float, integer

License

MIT