package
Render interfaces using pure functions and virtual DOM
npm install dekuGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Latest published Jan 26, 2016
latest
Deku is a library for rendering interfaces using pure functions and virtual DOM.
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 5 modules packaged together for convenience:
element: Create virtual elements.diff: Compute the difference between two virtual elements. You can use this if you're creating a custom renderer.dom: Create DOM elements from virtual elements and update them using the result of a diff. You'll only use this directly if you're building your own app creator.string: Render a HTML string from virtual elements.createApp: Kickstart an app for the browser.npm install --save dekuWe support the latest two versions of each browser. This means we only support IE10+.
/** @jsx element */
import {element, createApp} from 'deku'
import {createStore} from 'redux'
import reducer from './reducer'
// Dispatch an action when the button is clicked
let log = dispatch => event => {
dispatch({
type: 'CLICKED'
})
}
// Define a state-less component
let MyButton = {
render: ({ props, children, dispatch }) => {
return <button onClick={log(dispatch)}>{children}</button>
}
You can read the documentation online.
The MIT License (MIT) Copyright (c) 2015 Anthony Short
stevenmiller888
stevenmiller888@me.com
Estimated unpacked size across 12 packages.
1.4 MB
Includes dependencies.
7 direct · 3 outdated
0.0.2
2.0.2
0.1.12
0.1.12
1.0.3
1.0.4
0.2.0
0.2.0
0.1.6
0.4.1
1.0.1
1.0.1
2.1.0