0.0.11 • Published 9 years ago

vdom-input v0.0.11

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

vdom input

virtual-dom wrapper around an input element. Returns an observable state object usable with the mercury interface.

install

$ npm install vdom-input

example

var vdom = require('virtual-dom');
var h = vdom.h;
var Input = require('vdom-input');

// return observable state object
var state = Input({

  value: 'example',

  // passed to html element
  attrs: {
    style: {
      color: 'red'
    },
    placeholder: 'placeholder'
  },

  // tab in an input that contains text
  onComplete: function() {
    console.log('complete');
  },
  // backspace in an input without any value
  onDelete: function() {
    console.log("delete");
  }

});

var loop = require('main-loop')(state(), Input.render, vdom);
state(loop.update);
document.getElementById('content').appendChild(loop.target);

methods

Input.hasValue(state)

Return boolean

0.0.11

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.0

10 years ago