redux-riot

0.0.8 • Public • Published

redux-riot

npm version travis build

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

Readme

Keywords

Package Sidebar

Install

npm i redux-riot

Weekly Downloads

6

Version

0.0.8

License

MIT

Last publish

Collaborators

  • horneds