[wip] Reactive interface library built for browserify. Features include:
- virtual dom
- small, readable source
- event based interface
- es6 ready
- easily testable
- flux compatible
$ npm install rix
const rix = require('rix')
const button = rix.dom((dom, state, props) => {
return dom('button', { onClick: handleClick }, [state.text])
})
button.on('mount', (el, state, props) => {
state = {
text: 'click me',
count: 0
}
})
document.body.appendChild(rix.createElement(button))
function handleClick(el, state, props, e) {
const count = state.count++
state = {
text: 'clicked ' + count + ' times',
count: count
}
}
Nowadays there's plenty of choice in ui libraries that have a virtual dom. Unfortunately they're either hard to learn, lack features or are just not very user friendly. Rix tries to merge the best ideas from those libraries and wrap them in a clean, event-based interface.