README
vdom file upload
File upload UI component for virtual dom rendering engine.
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);