Rxjs: Update static operators to accept promises across the board

Created on 17 Mar 2016  路  9Comments  路  Source: ReactiveX/rxjs

A lot of this is my fault, but given that we've decided to interop with promises in most places, we should probably ensure we do it consistently. That means updating the family of static defer creation operators (defer, if, using, etc.) to accept promises, lowercase-o observables, etc. to use our internal subscribeToResult function.

Most helpful comment

Really, there shouldn't be anything public facing that "accepts" Observable<T>, it should always accept SubscribableOrPromise<T>. Or at the very least Subscribable<T>. Having a function that accepts a strict class type is a 101 mistake, we should have been using interfaces this whole time.

All 9 comments

@kwonoj yes it is

Really, there shouldn't be anything public facing that "accepts" Observable<T>, it should always accept SubscribableOrPromise<T>. Or at the very least Subscribable<T>. Having a function that accepts a strict class type is a 101 mistake, we should have been using interfaces this whole time.

We should probably make separate issues for the operators in question.

Can I remind people that if future PRs change the signature of an operator, please remember to update also the docs that I wrote for them. Otherwise docs will be a moving target

I think this one's covered mostly, can this be closed maybe? (Assume ConnectableObservable is not fall into this?)

I think most static operators are now covered as commented, /cc @blesh for visibility before closing this out and switching to open issues for each individuals, in case I miss something should be covered before closing.

Closing this, if there's remaining operator will file separate.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dooreelko picture dooreelko  路  3Comments

OliverJAsh picture OliverJAsh  路  3Comments

haf picture haf  路  3Comments

jakovljevic-mladen picture jakovljevic-mladen  路  3Comments

giovannicandido picture giovannicandido  路  4Comments