This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This doesn't work, it's just a draft while thinking how best to model collections of non-trivial objects | |
| const model = (function () { | |
| const mediaAsset$ = createStream(droppedFiles$.filter(droppedFile => droppedFile.type.match('image.*')) | |
| .map (droppedfile => { | |
| const reader = new FileReader(); | |
| const asset = { | |
| id = cuid(), | |
| name = droppedfile.name, | |
| imageLoadSucceeded$ = Rx.Observable.fromEvent(reader.onload).map(_ => reader.result), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var h = require('virtual-dom/h'); | |
| var diff = require('virtual-dom/diff'); | |
| var patch = require('virtual-dom/patch'); | |
| var createElement = require('virtual-dom/create-element'); | |
| // 1: Create a function that declares what the DOM should look like | |
| function render(value) { | |
| return h('input', { | |
| attributes: { | |
| class: "form-control", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var h = require('virtual-dom/h'); | |
| var diff = require('virtual-dom/diff'); | |
| var patch = require('virtual-dom/patch'); | |
| var createElement = require('virtual-dom/create-element'); | |
| // 1: Create a function that declares what the DOM should look like | |
| function render(value) { | |
| return h('input', { | |
| className: "form-control", | |
| type: "range", |
NewerOlder