Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deku

Package Overview
Dependencies
Maintainers
3
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deku

Create view components using a virtual DOM

  • 2.0.0-rc1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
538
increased by16.96%
Maintainers
3
Weekly downloads
 
Created
Source

Deku Circle CI

version js-standard-style npm downloads

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 elements
  • diff: Computing the difference between two virtual elements
  • dom: DOM renderer
  • string: HTML string renderer

Installation

npm install --save deku

We support the latest two versions of each browser. This means we only support IE10+.

Sauce Test Status

Example

import {dom, element} from 'deku'
import {createStore} from 'redux'
import reducer from './reducer'

// Create a Redux store to handle actions and side-effects
let store = createStore(reducer)

// Create a renderer that can turn vnodes into real DOM elements
let render = dom.createRenderer(document.body, store.dispatch)

// Define a state-less component
let MyButton = {
  render: ({ props, children }) {
    return <button class="my-button">{children}</button>
  }
}

// Update the page and add redux state to the context
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

FAQs

Package last updated on 28 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc