deku-redux
v1.1.2
Published
Redux bindings for deku
Downloads
18
Readme
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.