cyclejs-redux
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

cyclejs-storage

A Cycle.js Driver for using redux.

Installation

npm install --save cyclejs-redux

Usage

Basics:

import Cycle from '@cycle/xstream-run';
import { makeStateDriver } from 'cyclejs-redux';
 
function reducer(state, action)
{
    switch(action.type)
    {
    case 'increment': return Object.assign({}, state, { counter: state.counter + 1 });
    case 'decrement': return Object.assign({}, state, { counter: state.counter - 1 });
    default: return state;
    }
}
 
function main(sources) {
  // ...
}
 
const drivers = {
  storage: makeStateDriver(reducer, { counter: 0 })
}
 
Cycle.run(main, drivers);

Dependencies (1)

Dev Dependencies (3)

Package Sidebar

Install

npm i cyclejs-redux

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • supermanitu