redux-riot
v0.0.8
Published
Redux support for your Riot application
Downloads
25
Readme
redux-riot
A Riot integration to Redux
Installation
npm install --save redux-riot
Dependencies
redux-riot
depends on redux
, riot
.
How to use?
Configure and setup the mixin
import Riot from 'riot'
import RiotReduxMixin from 'redux-riot';
import {createStore} from 'redux';
const store = createStore(
// ...
)
Riot.mixin(RiotReduxMixin(store)) // install globally
Riot.mixin('redux', RiotReduxMixin(store)) // or shared
Use in your tags
// Initialize the mixin
// (skip this if the mixin is installed globally)
this.mixin('redux')
// Subscribe to state changes (reselect is supported)
this.subscribe( (state) => state.some )
this.subscribe( require('./selector'))
this.subscribe( require('./selector'), callback )
// Bind actions to this.actions
this.actions( require('./actions') )
// Use binded actions
this.actions.select('payload')
License
This project is licensed under the MIT license, Copyright (c) 2017 Kirill Klenov. For more information see LICENSE.md
.
Acknowledgements
Dan Abramov for Redux and Riot team for Riot. A Simple and elegant component-based UI library