Created
November 20, 2018 18:14
-
-
Save lumie1337/9d751abc5b588bad51c9bd53e29e1e4d to your computer and use it in GitHub Desktop.
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 append = (a) => (e) => React.createElement(React.Fragment, {}, e, a) | |
const id = (a) => a | |
const when = (cond, action) => cond ? action : id | |
function compose(...args) { } | |
function nicer(type) { | |
return compose( | |
when(type === "edit", append(<div></div>)), | |
when(false, (e) => <div><span>{e}</span></div>), | |
when(true, append(<div></div>)), | |
)(base); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment