RXJS 5.subscribe () with no arguments

So quick question. I have been using RxJS 5 for several months, and I came across some behavior that I really don't understand, because I could not find it anywhere.

I am in a situation where subscribing to an observable chain using just .subscribe(); does not cause observable.

However, if I add the onNext callback (empty or not), the observed triggers and chain processes are: .subscribe(() => {});

Can anyone explain why this is happening?

EDIT2 - Remote Irrelevant Example

+7
angular typescript ionic2 rxjs5 subscribe
source share
2 answers

Thanks to Damian Hercun for reporting that this was a fixed bug in RxJS 5.4.2.

information:

https://github.com/ReactiveX/rxjs/pull/1935

https://github.com/ReactiveX/rxjs/issues/1921

+1
source share

.subscribe() does not actually require any parameters, it will simply create emptyObserver if none are specified, which should work just as well.

It is possible that in some versions of 5.0.0 beta there are problems associated with this - if you use one of these versions, you should upgrade to a more stable version.

 const obs$ = Rx.Observable.of("Foo") .do(() => console.log("triggered!")); obs$.subscribe(); obs$.subscribe(); 
 <script src="https://unpkg.com/ rxjs@5.1.1 /bundles/Rx.min.js"></script> 
+3
source share

All Articles