“rxjs” observable.throw is not a function – Angular4

The error There are multiple modules with names that only differ in casing. is indicating the wrong import is being targeted with how you are trying to use Observable. The import should be with a capital “O” like: import { Observable } from ‘rxjs/Observable’; This will import the individual Observable operator, which be used in … Read more

Observable not assignable to type Observable

I think that your problem is located here: getRisks(): Observable<RiskListSummary[]> { return this.http.get(this.serviceUrl) .map(this.extractData()) <== passing result of function .catch(this.handleError()); <== passing result of function } You could use just passing function reference: getRisks(): Observable<RiskListSummary[]> { return this.http.get(this.serviceUrl) .map(this.extractData) .catch(this.handleError); } but this way you will lose this. Or you could use bind method to … Read more

When should I use `publishReplay` vs `shareReplay`?

shareReplay() is basically publishReplay().refCount() Definitely not. Both shareReplay and publishReplay (+ calling connect on it) will make the observable behind it hot. But the very important difference between them is: shareReplay: won’t stop emitting until it’s completed, no matter if there are no subscriptions anymore or not. publishReplay: will stop after the last subscriber unsubscribes … Read more

Angular 6 / Rxjs – how to basics: observables success, error, finally

I think there’s one key misunderstanding: You either have someone who wants “success and finally”, or “success and error” but none wants the 3 of them. This isn’t entirely true. Each Observable can send zero or more next notifications and one error or complete notification but never both. For example when making a successful HTTP … Read more

How to achieve a debounce service on input keyup event in angular2 with rxjs

So the chain is really correct but the problem is that you’re creating an Observable and subscribe to it on every keyup event. That’s why it prints the same value multiple times. There’re simply multiple subscriptions which is not what you want to do. There’re obviously more ways to do it correctly, for example: @Component({ … Read more

What’s the difference between Knockout.js and Rx.js?

Steve (the creator of Knockout) explained the difference on his blog: I’m very familiar with Rx for JavaScript, having recently used it heavily on a big project, and in fact aspects of the design of Knockout are made with my Rx experiences in mind. The key difference between Knockout’s implementation of the observer pattern and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)