Deku
Deku is a library for rendering interfaces using pure functions.
Instead of using classes and local state, Deku just uses functions and pushes the responsibility of all state management and side-effects onto tools like Redux. It also aims to support only modern browsers to keep things simple.
It can be used in place of libraries like React and works well with Redux and other libraries in the React ecosystem.
Deku consists of 4 modules packaged together for convenience:
element
: Creating virtual elementsdiff
: Computing the difference between two virtual elementsdom
: DOM rendererstring
: HTML string renderer
Installation
npm install --save deku
We support the latest two versions of each browser. This means we only support IE10+.
Example
import {dom, element} from 'deku'
import {createStore} from 'redux'
import reducer from './reducer'
let store = createStore(reducer)
let render = dom.createRenderer(document.body, store.dispatch)
let MyButton = {
render: ({ props, children }) {
return <button class="my-button">{children}</button>
}
}
render(
<MyButton>Hello World!</MyButton>,
store.getState()
)
Documentation
You can read the documentation online at Gitbook.
License
The MIT License (MIT) Copyright (c) 2015 Anthony Short