Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Support for v5.0.0 #105

Open
mickeyvip opened this issue Jan 18, 2016 · 8 comments
Open

Support for v5.0.0 #105

mickeyvip opened this issue Jan 18, 2016 · 8 comments

Comments

@mickeyvip
Copy link

Hello.

The version 5.0.0 of Rx (https://github.com/ReactiveX/RxJS) is in beta.

Will RxJS-DOM be supporting the new version?

Thank you.

@mattpodwysocki
Copy link
Member

@mickeyvip yes, but it will be built in at some point. cc @trxcllnt who is working on just that, although some things need to be addressed such as how fromEvent differs here than in the fromEvent in RxJS core.

@trxcllnt
Copy link
Contributor

@mickeyvip @mattpodwysocki so far ReactiveX/RxJS has Observable.ajax, Observable.ajax.get, Observable.ajax.put, Observable.ajax.post, Observable.ajax.delete, Observable.ajax.getJSON, Observable.webSocket, and Scheduler.animationFrame.

You should be able to access these via import {Observable, Scheduler} from rxjs/Rx.DOM;

@mattpodwysocki
Copy link
Member

@trxcllnt are we planning on bringing all of the DOM stuff over relatively soon?

@trxcllnt
Copy link
Contributor

@mattpodwysocki we haven't filed issues for the missing items yet, but we should. I forgot we also already have the microtask scheduler (aka the asapScheduler) implemented.

From what I can tell, we're missing the following items:

edit: also, it seems the fromEvent implementation we currently have doesn't allow us to specify the capturing phase, so we'll need to change it or add another method specific to DOM events.

@mickeyvip
Copy link
Author

@mattpodwysocki, @trxcllnt, thank you so much!

@franciclo
Copy link

Is there any way to use it with rxjs 5 now?
is kind of tedious to dispose some streams as .dispose() and other as .unsubscribe()

@trxcllnt
Copy link
Contributor

trxcllnt commented Jul 2, 2016

@franciclo If you have code written with Rx4 naming conventions, the quickest solution is to alias from new to old up front. Here's what we're currently aliasing in our projects at work:

import Rx from 'rxjs';

Rx.Observable.return = (value) => Rx.Observable.of(value);

Rx.Subject.prototype.onNext = Rx.Subject.prototype.next;
Rx.Subject.prototype.onError = Rx.Subject.prototype.error;
Rx.Subject.prototype.onCompleted = Rx.Subject.prototype.complete;
Rx.Subject.prototype.dispose = Rx.Subscriber.prototype.unsubscribe;
Rx.AsyncSubject.prototype.onNext = Rx.AsyncSubject.prototype.next;
Rx.AsyncSubject.prototype.onCompleted = Rx.AsyncSubject.prototype.complete;
Rx.BehaviorSubject.prototype.onNext = Rx.BehaviorSubject.prototype.next;
Rx.ReplaySubject.prototype.onNext = Rx.ReplaySubject.prototype.next;

Rx.Subscriber.prototype.onNext = Rx.Subscriber.prototype.next;
Rx.Subscriber.prototype.onError = Rx.Subscriber.prototype.error;
Rx.Subscriber.prototype.onCompleted = Rx.Subscriber.prototype.complete;
Rx.Subscriber.prototype.dispose = Rx.Subscriber.prototype.unsubscribe;

Rx.Subscription.prototype.dispose = Rx.Subscription.prototype.unsubscribe;

@franciclo
Copy link

franciclo commented Jul 3, 2016

Right, that will patch it up, thank you for your time

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants