0.0.4 • Published 8 years ago

vdom-file-upload v0.0.4

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

vdom file upload

File upload UI component for virtual dom rendering engine.

demo

install

$ npm install vdom-file-upload

example

var vdom = require('virtual-dom');
var FileUpload = require('vdom-file-upload');

// return `observ-struct` instance
var state = FileUpload({
  label: 'example',
  onChange: function(files) {
    console.log('change', files);
  }
});

var loop = require('main-loop')(
  state(),
  // pass in a hyperscript function
  FileUpload.render.bind(null, vdom.h),
  vdom
);

state(loop.update);
document.getElementById('content').appendChild(loop.target);