Category "rxjs"

Filtering an observable array into another observable array (of another type) by an observable property of the items

As the title probably doesn't explain to well what I am doing, I'll give a small example: A REST api returns a list of objects. For each of them, a checkbox sh

use distinctUntilChanged on objects

How can I have distinctUntilChanged work with objects like this myObs = Observable.from([{foo: 'bar'}, {foo: 'bar'}]); myObs.distinctUntilChanged() .subscri

use distinctUntilChanged on objects

How can I have distinctUntilChanged work with objects like this myObs = Observable.from([{foo: 'bar'}, {foo: 'bar'}]); myObs.distinctUntilChanged() .subscri

Why property does not exist on type in rxjs pipe function?

Why I losing the type in my pipe function? How to fix that? Property 'n' does not exist on type '{}' stackblitz import { of, map, Observable, Subject, pipe, t

Take once only when a boolean changes from false to true

I have multiple boolean properties which are false by default, but that may only be set to true at the start of the application. Should the property become true

How to convert Observable<any> to array[]

I have following method in typescript, I need to bind to angular grid CountryService GetCountries() { return this.http.get(`http://services.groupkt.com/co

ng2-translate customLoader & multiple files per language

In an Ionic2 app I'm using ng2-translate the strings in my app. Now I need to split the translation file into several files per language, for example de.json an

Pausable buffer with RxJS

I'm trying to implement a togglable auto-save feature using RxJS streams. The goal is to: While auto-save is enabled, send changes to the server as they come.

Angular 11 switchmap not working after catch error

I have two dropdowns in my angular app. Second one is populated based on first dropdown value. I am using switchmap. It works fine as long as there is no error.

RxJS: takeUntil() Angular component's ngOnDestroy()

tl;dr: Basically I want to marry Angular's ngOnDestroy with the Rxjs takeUntil() operator. -- is that possible? I have an Angular component that opens several

RxJS: Removing fields from an object

Lets say I have an object with 4 fields like this: obj = {a:"3", b:"7", c:"10", d:"123"} and I need to 'narrow' it to an object with fewer fields, like that:

Angular click debounce

In my template I have a field and two buttons: <div class="btn-plus" (click)="add(1)"> - </div> <div class="txt"> {{ myValue }} </div>

Rxjs - resubscribe to unsubscribed Observable

I'm using a Service to "ping" my server every 2.5s, returning the response time from my server. Therefore I am using observables. I am also using angular 2 an

RxJs catch error and continue

I have a list of items to parse, but the parsing of one of them can fail. What is the "Rx-Way" to catch error but continue executing the sequence Code Sample:

Property 'subscribe' does not exist on type 'OperatorFunction<Response, Recipe[]>'

I'm trying to fetch data from firebase, but facing an error "Property 'subscribe' does not exist on type 'OperatorFunction'" any idea? whats missing here

When to use asObservable() in rxjs?

I am wondering what is the use of asObservable: As per docs: An observable sequence that hides the identity of the source sequence. But why would you

Is it possible to add observables to a combineLatest (or similar) at run time?

I have this use case. A component should NOT be visible when from a list of Boolean observables one of those is true. That is the easy part, for this, I have my

NgXs @selector doesn't support async functions

Inside my NGXS store I have the following async selector @Selector() static async mainState(store: IMyStore): Promise<IMyState> { return this.getActiv

Prevent multiple identical http calls from Angular service

I've a service to get the data from an API in my angular app. The service is used in different components - and the same http request is send multiple times. To

RxJs - lossy zip marble testing

Following this post I've decided to write a marble test for this operator. Here is a basic test: it('Test lossy zip', () => { const a = hot('a---a-