https://github.com/troch/deku-redux
Bindings for redux in deku < v2
https://github.com/troch/deku-redux
Last synced: 10 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 (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-04T00:12:36.000Z (almost 10 years ago)
- Last Synced: 2025-10-10T04:42:39.993Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 30
- Watchers: 3
- 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)
- awesome-redux - deku-redux - Bindings for redux in deku (Standalone plugin)
- fucking-awesome-redux - deku-redux - Bindings for redux in deku (Standalone plugin)
README
[](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.