git init git-demo
cd git-demo
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
import { curry, compose, toUpper, pipe } from 'ramda'; | |
// #region listeners | |
const _log = (value) => console.log(value); | |
// #endregion | |
// #region broadcasters | |
const done = Symbol('done'); | |
const addListener = curry((element, eventType, listener) => { | |
return element.addEventListener(evenType, listener); |
const doorMachine = Machine({ | |
id: "door", | |
initial: "locked", | |
states: { | |
unlocked: { | |
initial: "closed", | |
states: { | |
open: { | |
on: { |
const { curry, compose, State, mapProps } = require("crocks"); | |
const { modify } = State; | |
const state = { | |
left: 8, | |
moves: 0 | |
}; | |
const inc = x => x + 1; |
angular.directive('dblScroll', dblScroll) | |
dblSroll.$inject = [ | |
'$timeout' | |
]; | |
function dblScroll($timeout) { | |
return { | |
restrict: 'A', | |
transclude: true, |
function spyOn<O extends object, P extends keyof O>(obj: O, prop: P) { | |
console.log(obj, prop); | |
} | |
interface IPerson { | |
name: string, | |
age: number | |
} | |
const person: IPerson = { |
const chai = require('chai'); | |
const expect = chai.expect; | |
const chaiAsPromised = require('chai-as-promised'); | |
const index = require('../index.js'); | |
chai.use(chaiAsPromised); | |
describe('Function foo', () => { | |
it('should accpet anything but one', () => { |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>GistRun</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<nav> | |
nav |