redux-middleware-rxjs
v0.0.3
Published
rxjs helpers
Downloads
5
Readme
redux-middleware-rxjs
An unopinionated way to integrate rxjs with redux.
Install
npm install redux-middleware-rxjs --save
Usage
import {filter, mapTo} from 'rxjs/operators'
import {createRxMiddleware} from 'redux-middleware-rxjs'
import {createStore, applyMiddleware} from 'redux'
const middleware = createRxMiddleware(
obs=> obs.pipe(
filter(action=> action.type === 'increase'),
mapTo({type: 'decrease'})
)
)
const store = createStore(/* reducer */, applyMiddleware(middleware))
createRxMiddleware
receives one or many rxjs operators.
License
MIT