Reactive-Extensions / RxJS-DOM

HTML DOM Bindings for the Reactive Extensions for JavaScript
http://reactivex.io
Other
437 stars 99 forks source link

Support for v5.0.0 #105

Open mickeyvip opened 8 years ago

mickeyvip commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

@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 commented 8 years ago

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

trxcllnt commented 8 years ago

@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 commented 8 years ago

@mattpodwysocki, @trxcllnt, thank you so much!

franciclo commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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