The web components spec says there are four parts
- templates
- custom elements
- shadow dom
- html imports
disclaimer: I might be terribly wrong. This is a set of naive observations.
| var mercury = require("mercury") | |
| var h = mercury.h | |
| var events = mercury.input(["reset"]) | |
| var state = mercury.hash({ | |
| isReset: mercury.value(false), | |
| events: events | |
| }) |
| var mercury = require("mercury") | |
| var h = mercury.h | |
| var events = mercury.input(["change"]) | |
| var textValue = mercury.value("") | |
| events.change(function (data) { | |
| textValue.set(data.text) | |
| }) |
| var mercury = require("mercury") | |
| var h = mercury.h | |
| var events = mercury.input(["height", "weight", "bmi"]) | |
| var bmiData = mercury.hash({ | |
| height: mercury.value(180), | |
| weight: mercury.value(80), | |
| bmi: mercury.value(calcBmi(180, 80)) | |
| }) |
| var GithubWidget = require('github-widget/element') |
| type VNode := { | |
| tagName: String, | |
| (* properties has a set of well defined | |
| optional properties. | |
| However it also has wildcard keys like | |
| 'data-foo': Any | |
| and onfoo: Function | |
| *) |
| var test = require('tape'); | |
| test('setup entire integration test', function (assert) { | |
| series([ | |
| spawnRedis, | |
| spawnChildProcess | |
| ], assert.end.bind(assert)) | |
| }) | |
| process.nextTick(function () { |
| cd ~/tmp | |
| mkdir foo | |
| cd foo | |
| nvm use 0.8.26 | |
| npm init | |
| npm i request -S --verbose # hangs |
The web components spec says there are four parts
disclaimer: I might be terribly wrong. This is a set of naive observations.
| // foldp := (Signal<A>, (B, A) => B, B) => Signal<B> | |
| function foldp(source, lambda, initial) { | |
| var result = Signal(initial) | |
| source.listen(function (ev) { | |
| result.set(lambda(result.get(), ev)) | |
| }) | |
| return result | |
| } |