This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { toggler: true }, | |
reducers: { | |
toggle: (action, state) => ({ toggler: !state.toggler }) | |
} | |
}) |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { toggler: true }, | |
reducers: { | |
toggle: (action, state) => ({ toggler: !state.toggler }) | |
} | |
}) |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { toggler: true }, | |
reducers: { | |
toggle: (action, state) => ({ toggler: !state.toggler }) | |
} | |
}) |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { toggler: true }, | |
reducers: { | |
toggle: (action, state) => ({ toggler: !state.toggler }) | |
} | |
}) |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { toggler: true }, | |
reducers: { | |
toggle: (action, state) => ({ toggler: !state.toggler }) | |
} | |
}) |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
const debounce = require('debounce') | |
const simulateWorkFor = (ms) => { | |
const startTime = new Date().getTime() | |
while (new Date().getTime() - startTime < ms) { | |
// nothing | |
} |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
const debounce = require('debounce') | |
const simulateWorkFor = (ms) => { | |
const startTime = new Date().getTime() | |
while (new Date().getTime() - startTime < ms) { | |
// nothing | |
} |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { | |
title: 'Set the title' | |
}, | |
reducers: { | |
update: (data, state) => { |
This file contains 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
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { | |
title: 'Set the title' | |
}, | |
reducers: { | |
update: (data, state) => { |
This file contains 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
const mutate = require('xtend/mutable') | |
const assert = require('assert') | |
const xtend = require('xtend') | |
function applyHook (arr, arg1, arg2, arg3, arg4, arg5) { | |
arr.forEach(function (fn) { | |
fn(arg1, arg2, arg3, arg4, arg5) | |
}) | |
} |