Last active
August 21, 2019 14:35
-
-
Save PartyLich/17bcb111a0c9171ce73b0dee5f9c8290 to your computer and use it in GitHub Desktop.
Scaramouche! Scaramouche! Will you do the fandango?
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
(function Opera() { | |
const pipe = (...fns) => (x) => fns.reduce((v, f) => f(v), x); | |
const open = (obj = {}) => Object.assign({}, obj, {open: true}); | |
const lookUpTo = (target) => (obj) => | |
Object.assign({}, obj, {lookingAt: target}); | |
const see = (obj) => Object.assign({}, obj, {canSee: true}); | |
if (isRealLife || isFantasy) { | |
const state = { | |
caughtInLandslide: true, | |
escapeFromReality: false, | |
}; | |
let yourEyes = pipe( | |
open, | |
lookUpTo('the sky'), | |
see | |
)(); | |
const iAm = new PoorBoy(state); | |
function PoorBoy(initState) { | |
let _state = { | |
needsSympathy : false, | |
easyCome : true, | |
easyGo : true, | |
littleHigh : true, | |
littleLow : true, | |
}; | |
this.windBlow = (direction) => null; // noop | |
return Object.assign(this, _state, initState); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment