Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created September 24, 2018 02:40
Show Gist options
  • Save fakenickels/03e79b67dd87e7f8d86ae48cd1523add to your computer and use it in GitHub Desktop.
Save fakenickels/03e79b67dd87e7f8d86ae48cd1523add to your computer and use it in GitHub Desktop.
import React from 'react'
import immutagen from 'immutagen'
export default component => {
const generator = immutagen(component)
const compose = context => {
const value = context.value
return context.next
? React.cloneElement(value, null, values => compose(context.next(values)))
: value
}
function Epitath(props) {
return compose(generator(props))
}
Epitath.displayName = `EpitathContainer(${component.displayName || 'anonymous'})`
return Epitath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment