Skip to content

Instantly share code, notes, and snippets.

@PartyLich
Last active August 21, 2019 14:35
Show Gist options
  • Save PartyLich/17bcb111a0c9171ce73b0dee5f9c8290 to your computer and use it in GitHub Desktop.
Save PartyLich/17bcb111a0c9171ce73b0dee5f9c8290 to your computer and use it in GitHub Desktop.
Scaramouche! Scaramouche! Will you do the fandango?
(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