Category "rxjs"

How to check pending schedules in queue schedular of RxJS?

I am using this code in for loop: my purpose was to once I get response of 1st request then only it should execute second request then 3rd and so on. queueSche

Polling requests using rjxs and angular

I am trying to create continuous polling using rxjs and angular. Below is an implementation of my requirement. My app.component template has for instance 2 or

Why does Angular httpClient returns an Observable instead of a Promise? [closed]

I made a spring reactive backend which returns Flux<> object. When I call the service with angular httpClient and subscribe to the obser

ngrx selector return same values multiple times

I have a export const selectIDs = creteSelector( selectorFeature, (feature: Feature) => { return feature?.metadata?.ids || [] } } in the

What is the difference between tap and map in RxJS?

I read the difference from the article but the main points look like this. so with tap I can change the variables such as that if I put x=3+4 then it changes t

Connecting a WebSocket in Angular

I have WebSocket Connection in Node which works fine. Now I want to use it in Angular with a rxjs websocket, but I have no idea how to solve the connection. co

Do I need to unsubscribe from an Observable if the Observable is finished with?

Let us say I have an Observable (hot, doesn't complete), and I subscribe to it. Ordinarily when I am finished with the Subscription I have to unsubscribe it to

How to use Jest useFakeTimers with RXJS?

My application is primarily using React Redux. We have a few places that use RXJS to simplify things. I just started using jest.useFakeTimers. I realized that g

Rxjs, retry 3 times, wait 30 seconds, then repeat

I'm using rxjs to connect to a WebSocket service, and in case of failure, I want to retry 3 times, wait 30 seconds, then repeat infinitely, how can I do this?

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: