Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
deku
Advanced tools
Readme
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 deku
We 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>
}
}
// Create a Redux store to handle all UI actions and side-effects
let store = createStore(reducer)
// Create an app that can turn vnodes into real DOM elements
let render = createApp(document.body, store.dispatch)
// Update the page and add redux state to the context
render(
<MyButton>Hello World!</MyButton>,
store.getState()
)
You can read the documentation online.
The MIT License (MIT) Copyright (c) 2015 Anthony Short
FAQs
Render interfaces using pure functions and virtual DOM
The npm package deku receives a total of 291 weekly downloads. As such, deku popularity was classified as not popular.
We found that deku demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.