View debounce.js
function debounce (fn, wait) {
var timeout
return function () {
var context = this
var args = arguments
var later = function () {
timeout = null
fn.apply(context, args)
}
clearTimeout(timeout)
View trite-component.js
var html = require('yo-yo')
module.exports = function Component () {
var currentState
var element
function render (state) {
if (!element) {
currentState = state
return element = create(currentState)
View trite-view.js
var html = require('yo-yo')
module.exports = function View (store) {
var currentState = store.getState()
var subscribe = store.subscribe
var unsubscribe
var element
function load () {
unsubscribe = subscribe(update)
View AuntieSister.js
function walk(n, o, update, target) {
tree = update(n, o, target)
n = n.firstChildElement
o = o.firstChildElement
target = tree.firstChildElement
while (n || o) {
walk(n, o, update)
n = n.nextElementSibling
o = n.nextElementSibling
}
View nanobel.js
var html = require('bel')
var nanomorph = require('nanomorph')
var cache = require('cache-element')
var stuff = [
[{
title: 1
}, {
title: 2
}, {
title: 3
View nanobel.js
var html = require('bel')
var nanomorph = require('nanomorph')
var cache = require('cache-element')
var stuff = [
[{
title: 1
}, {
title: 2
}, {
title: 3
View memoizeNode.js
const elType = 'div'
module.exports = function memoizeNode (node) {
var placeholder = null
var element = null
var args = null
return function render () {
const _args = arguments
if (!element) {
View memoizeNode.js
module.exports = function memoizeNode(node) {
var element
var placeholder
var mounted = false
return function render() {
if(!element) {
element = node
mounted = true
return element
}
View factor.sh
browserify ./screens/*.js -p [ factor-bundle -o 'tee > bundle/`basename $FILE`' ] -o bundle/common.js
View tinytest.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>tiny tests</title>
<style>
body {
font-family: sans-serif;
padding: 3rem;
}