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 choop = require('choop') | |
var html = require('choop/html') | |
var h = require('choop/h') | |
var preact = require('preact') | |
var devtools = require('choo-devtools') | |
var Nanocomponent = require('nanocomponent') | |
var bel = require('bel') | |
var app = choop() | |
app.use(devtools()) |
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 choop = require('choop') | |
var html = require('choop/html') | |
var h = require('choop/h') | |
var Component = require('choop/component') | |
var devtools = require('choo-devtools') | |
var app = choop() | |
app.use(devtools()) | |
app.route('*', mainView) | |
app.mount('body') |
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
/** @jsx h */ | |
var devtools = require('choo-devtools') | |
var choop = require('choop') | |
var h = require('choop/h') | |
var app = choop() | |
app.use(devtools()) | |
app.use(countStore) | |
app.route('*', mainView) | |
app.mount('body') |
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 html = require('choop/html') | |
var devtools = require('choo-devtools') | |
var choop = require('choop') | |
var app = choop() | |
app.use(devtools()) | |
app.use(countStore) | |
app.route('*', mainView) | |
app.mount('body') |
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 fs = require('fs') | |
var path = require('path') | |
var r2 = require('r2') | |
var x = require('xtend') | |
var packageJson = require('package-json') | |
var latestVersion = require('latest-version') | |
var prettyjson = require('json-format') | |
var raw = { | |
choo: 'https://raw.githubusercontent.com/choojs/choo/master/index.js' |
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 choo = require('choo') | |
var html = require('choo/html') | |
var app = choo() | |
console.log(app) | |
app.route('/', mainView) | |
app.mount('body') | |
function mainView (state, emit) { | |
return html` |
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
module.exports = function (state, emitter, app) { | |
state.component = require('component-box') | |
app.component = function (key, Component) { | |
if (!key || !Component) return | |
var obj = {} | |
obj[key] = function () { | |
return new Component() | |
} | |
state.component.use(obj) | |
} |
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 pelo = require('pelo') | |
var el = pelo`<div ${{ className: 'boop', style: 'color:red' }}>beep</div>` | |
document.write(el) |
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 bel = require('bel') | |
var el = bel`<div ${{ className: 'boop', style: 'color:red' }}>beep</div>` | |
document.body.appendChild(el) |
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 Nanocomponent = require('nanocomponent') | |
var html = require('bel') | |
var c = require('component-box') | |
class MyComponent extends Nanocomponent { | |
createElement (text) { | |
return html`<div>${text}</div>` | |
} | |
} |