ungoldman/hyperaxe

add optional default props to factory

ungoldman opened this issue · 1 comments

var x = require('hyperaxe')

var textInput = x('input', { type: 'text' })

textInput({ value: 'foo' })
// => <input type="text" value="foo" />

textInput({ type: 'email', value: 'foo' })
// => <input type="email" value="foo" />

could go one further and allow object as first param too

var x = require('hyperaxe')

var textInput = x({ tag: 'input', type: 'text' })

textInput({ value: 'foo' })
// => <input type="text" value="foo" />