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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Use RxJS v4 with redux-observable
This library is meant as a stop gap to help ease migration progressively, not as a band-aid for indefinite interop.
This has a peer dependency of rx@4.*.*
, which will have to be installed as well.
install --save redux-observable-adapter-rxjs-v4
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()
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();