Comparing version 2.0.0-rc4 to 2.0.0-rc5
@@ -11,3 +11,3 @@ # Getting started | ||
let MyButton = { | ||
render: ({ children }) { | ||
render: ({ children }) => { | ||
return <button class="my-button">{children}</button> | ||
@@ -14,0 +14,0 @@ } |
@@ -69,3 +69,3 @@ 'use strict'; | ||
} | ||
var child = createElement(node, (0, _utils.createPath)(path, node.key || index)); | ||
var child = createElement(node, (0, _utils.createPath)(path, node.key || index), dispatch, context); | ||
DOMElement.appendChild(child); | ||
@@ -72,0 +72,0 @@ }); |
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.dom = exports.string = exports.element = undefined; | ||
@@ -22,6 +23,4 @@ var _element = require('./element'); | ||
exports.default = { | ||
element: _element2.default, | ||
string: _string2.default, | ||
dom: _dom2.default | ||
}; | ||
exports.element = _element2.default; | ||
exports.string = _string2.default; | ||
exports.dom = _dom2.default; |
{ | ||
"name": "deku", | ||
"version": "2.0.0-rc4", | ||
"version": "2.0.0-rc5", | ||
"license": "MIT", | ||
@@ -36,2 +36,3 @@ "repository": "dekujs/deku", | ||
"is-dom": "^1.0.5", | ||
"rimraf": "^2.5.0", | ||
"snazzy": "^2.0.1", | ||
@@ -38,0 +39,0 @@ "standard": "^5.4.1", |
@@ -37,16 +37,24 @@ # Deku | ||
import reducer from './reducer' | ||
let {createRenderer} = dom | ||
// Create a Redux store to handle actions and side-effects | ||
let store = createStore(reducer) | ||
// Dispatch an action when the button is clicked | ||
let log = dispatch => event => { | ||
dispatch({ | ||
type: 'CLICKED' | ||
}) | ||
} | ||
// 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> | ||
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 a renderer that can turn vnodes into real DOM elements | ||
let render = createRenderer(document.body, store.dispatch) | ||
// Update the page and add redux state to the context | ||
@@ -61,3 +69,3 @@ render( | ||
You can [read the documentation online](https://anthonyshort.gitbooks.io/dekujs/content/) at Gitbook. | ||
You can [read the documentation online](https://dekujs.github.io/deku). | ||
@@ -64,0 +72,0 @@ ### License |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57727
73
18
792