Skip to content

Instantly share code, notes, and snippets.

@lumie1337
Created November 20, 2018 18:14
Show Gist options
  • Save lumie1337/9d751abc5b588bad51c9bd53e29e1e4d to your computer and use it in GitHub Desktop.
Save lumie1337/9d751abc5b588bad51c9bd53e29e1e4d to your computer and use it in GitHub Desktop.
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