Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/troch/deku-redux
Bindings for redux in deku < v2
https://github.com/troch/deku-redux
Last synced: about 2 months ago
JSON representation
Bindings for redux in deku < v2
- Host: GitHub
- URL: https://github.com/troch/deku-redux
- Owner: troch
- License: mit
- Created: 2015-10-31T11:27:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-04T00:12:36.000Z (over 8 years ago)
- Last Synced: 2024-10-06T10:47:07.108Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 30
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deku - deku-redux - connect component for redux (similar to react-redux) (Components)
- awesome-redux - deku-redux - Bindings for Redux in deku < v2. (Other Integrations / Deku)
README
[![Build Status](https://travis-ci.org/troch/deku-redux.svg?branch=master)](https://travis-ci.org/troch/deku-redux)
# deku-redux
> Bindings for redux in deku.
```sh
npm install deku-redux
```### Redux
Read the docs about Redux: __[Redux docs](http://rackt.org/redux/index.html)__.
If you are familiar with [react-redux](https://github.com/rackt/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.
```javascript
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](https://github.com/rackt/react-redux).
See __[Redux with React](http://rackt.org/redux/docs/basics/UsageWithReact.html)__ for more information on how to use.