Skip to content

Instantly share code, notes, and snippets.

@myobie
Created September 20, 2019 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myobie/68b16c6866e280ca378ed9e11eab99d5 to your computer and use it in GitHub Desktop.
Save myobie/68b16c6866e280ca378ed9e11eab99d5 to your computer and use it in GitHub Desktop.
const hyperx = require('hyperx')
const hx = hyperx((componentName, properties, children) => {
return ['createElement', componentName, properties, children]
}, (children) => {
return ['createFragment', children]
})
class Header {
async fetch (ctx) {
return {}
}
mapToChildProps (data) {
return {}
}
render (data, children) {
return `header ${children}`
}
}
class Buttons {
async fetch (ctx) {
return {}
}
render (data) {
return 'buttons'
}
}
const result = hx`
<Header>
<Buttons />
<Buttons />
<Buttons />
</Header>
`
console.log(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment