Skip to content

yoshuawuyts/rix

Repository files navigation

rix

NPM version build status Test coverage Downloads

[wip] Reactive interface library built for browserify. Features include:

  • virtual dom
  • small, readable source
  • event based interface
  • es6 ready
  • easily testable
  • flux compatible

Installation

$ npm install rix

Usage

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
  }
}

Why?

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.

See Also

License

MIT

About

[wip] Reactive interface library built for browserify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published