Bindings for redux in deku < v2
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
modules
scripts
test
.babelrc
.editorconfig
.eslintrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
package.json
rollup.config.js

README.md

Build Status

deku-redux

Bindings for redux in deku.

npm install deku-redux

Redux

Read the docs about Redux: Redux docs. If you are familiar with react-redux, deku-redux is very similar.

storePlugin(store)

Add your store to your tree with storePlugin. It is required for connect to be able to get access to your state.

import { tree, render } from 'deku';
import element from 'virtual-element';
import { createStore } from 'redux';
import { storePlugin } from 'deku-redux';
import reducers from './reducers';
import App from './components/App';

const store = createStore(reducers);

const app = tree()
    .use(storePlugin(store))
    .mount(element(App));

render(app, document.getElementById('app'));

connect([mapStateToProps], [mapDispatchToProps], [mergeProps])

Use connect higher-order component for connecting to your state, same as connect from react-redux.

See Redux with React for more information on how to use.