redux-observable/redux-observable-adapter-rxjs-v4

Name: redux-observable-adapter-rxjs-v4

Owner: redux-observable

Description: Use RxJS v4 in redux-observable Epics

Created: 2016-07-30 21:26:42.0

Updated: 2017-07-04 07:54:27.0

Pushed: 2017-05-02 16:11:25.0

Homepage: null

Size: 6

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

redux-observable-adapter-rxjs-v4

Use RxJS v4 with redux-observable

Please upgrade to 100% RxJS v5 ASAP

This library is meant as a stop gap to help ease migration progressively, not as a band-aid for indefinite interop.

Install

This has a peer dependency of rx@4.*.*, which will have to be installed as well.

install --save redux-observable-adapter-rxjs-v4
Usage

This library basically will convert the v5 ActionsObservable provided to your Epics into a v4 version. Then the v4 Observable you return will be converted back to v5 inside the middleware.

rt v4Adapter from 'redux-observable-adapter-rxjs-v4';

t epicMiddleware = createEpicMiddleware(rootEpic, { adapter: v4Adapter });

our Epics are now v4 streams

t fetchUserEpic = action$ =>
tion$.ofType(FETCH_USER)
.select(fetchUserFulfilled); // .select() is a v4-only operator for .map()
Upgrading to RxJS v5

We suggest you upgrade your app to use RxJS v5 as soon as possible. To ease that migration, you can also include the rxjs-compatibility library to start using RxJS v5 in your Epics while you transition the rest of your app away from v4.

After you've run patchObservables(), you can opt Epics into v5 (or v4) version with the new operators:

t exampleEpic = action$ =>
tion$.v4().anyV4Operators().v5();

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.