Skip to content

Instantly share code, notes, and snippets.

View jmakeig's full-sized avatar

Justin Makeig jmakeig

View GitHub Profile
@stravid
stravid / child-machine.js
Last active March 23, 2020 16:28
Statechart Parent Child Activity Example
const { Machine } = XState;
export default Machine({
id: 'child',
initial: 'present',
context: {
name: undefined
},
states: {
present: {
@joemfb
joemfb / search.peg
Created February 1, 2016 19:09
PEG.js search grammar
{
function joinNested(x) {
return x.map(function(y) {
return Array.isArray(y) ? joinNested(y) : y
}).join('')
}
}
// match all rules, consuming the entire input
root = a:all EOF { return a }