Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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

Something went wrong with that request. Please try again.