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 hash = varhash({}, function createItem(obj) { | |
return struct({ | |
id: obj.id, | |
title: value(obj.title), | |
description: value(obj.description) | |
}); | |
}); | |
hash.put('some-key', { | |
id: '1', |
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 mercury = require("mercury") | |
var h = mercury.h | |
var clicks = mercury.input() | |
var clickCount = mercury.value(0) | |
clicks(function () { | |
clickCount.set(clickCount() + 1) | |
}) |
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 mercury = require("mercury") | |
var h = mercury.h | |
var clicks = mercury.input() | |
var clickCount = mercury.value(0) | |
clicks(function () { | |
clickCount.set(clickCount() + 1) | |
}) |
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 mercury = require('mercury'); | |
var h = mercury.h; | |
var PopOver = (function () { | |
var offset = require('offset'); | |
PopOverFn.render = popoverRender; | |
PopOverFn.open = open; | |
PopOverFn.close = close; |
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 mercury = require("mercury") | |
var h = mercury.h | |
var state = mercury.hash({}) | |
function render(state) { | |
return h("ul", [ | |
h('li', h('a', { href: '#foo' }, 'link without array')), | |
h('li', [ h('a', { href: '#bar' }, 'link with array') ]) | |
]) |
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 mercury = require("mercury") | |
var h = mercury.h | |
var state = mercury.hash({}) | |
function render(state) { | |
return h("ul", [ | |
h('li', h('a', { href: '#foo' }, 'link without array')), | |
h('li', [ h('a', { href: '#bar' }, 'link with array') ]) | |
]) |
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 mercury = require("mercury") | |
var h = mercury.h | |
var state = mercury.hash({}) | |
function render(state) { | |
return h("ul", [ | |
h('li', h('a', { href: '#foo' }, 'link without array')), | |
h('li', [ h('a', { href: '#bar' }, 'link with array') ]) | |
]) |
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 GithubWidget = require('github-widget/element') | |
document.body.appendChild(GithubWidget('Raynos')) |
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 mercury = require('mercury'); | |
var h = mercury.h; | |
var events = mercury.input('change'); | |
var state = mercury.hash({ | |
text: mercury.state(''), | |
events: events | |
}); |
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 mercury = require('mercury'); | |
var h = mercury.h; | |
function CanvasWidget(paint, data) { | |
if (!(this instanceof CanvasWidget)) { | |
return new CanvasWidget(paint, data); | |
} | |
this.data = data; | |
this.paint = paint; |