Open mickeyvip opened 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.
@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;
@trxcllnt are we planning on bringing all of the DOM stuff over relatively soon?
@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.
@mattpodwysocki, @trxcllnt, thank you so much!
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()
@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;
Right, that will patch it up, thank you for your time
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.