Questions tagged [rxjs-observables]

759 questions
1
vote
1 answer

Possibly returning a nested observable: _scalar: false; Definetly returning undefined objects

I'm having an issue where I'm returning _scalar for a value in my object when I should be return the entire object. This one property in my object is stopping my code. The parameters are all return the correct values. I'm trying to document as much…
1
vote
0 answers

missing the following properties from type 'Observable'

I'm trying to learn rxjs observables for an ionic project. I've made some headway, but am stuck on a syntax error that I have no idea what it means. The message appeared after I added the pipe to the http.get. Any ideas of what is wrong and how to…
1
vote
1 answer

Subscribe to final observable after all observable completed?

I have this logic here, which creates many observable and executes a call back after each of them is done. from(rows).pipe( concatMap(row => this.uploadItem(row)) ).subscribe(response => { this.currentRowNode.data.uploadStatus =…
Francis Ducharme
  • 4,848
  • 6
  • 43
  • 81
1
vote
2 answers

RxJS - How to incrementally increase the delay time without using interval?

I want to incrementally increase the delay for this: const source = from(839283, 1123123, 63527, 4412454); // note: this is random const spread = source.pipe(concatMap(value => of(value).pipe(delay(1000)))); // how to incrementally increase the…
Jek
  • 5,546
  • 9
  • 37
  • 67
1
vote
0 answers

How to load a firebase-collection with all its subcollection in one promise?

I am currently trying to figure out how to load an angular/fire-collection including all of its subcollections with RxJS. This is my current approach: return this.collectionRef.valueChanges().pipe( flatMap((entities: Entity[]) => entity), …
1
vote
1 answer

using a function that calls observable with 3 different observables tied together with switch map. results in error

I have a function that runs when a file is uploaded to a html form. uploadidnexttofacepicture(event){ let subscription = this.s3service.publicresourceuploadtos3(event) .subscribe((req: any)=>{ console.log(req); }); …
1
vote
2 answers

How to modify an observable to bring a sub array item up to the top level properties - filtering by ID

I have a data structure like the following being returned as an observable using Akita state management, but in essence its just like any other observable, if there is some way to do this in Akita even better but any pointers with rxjs would be…
Kravitz
  • 2,769
  • 6
  • 26
  • 53
1
vote
1 answer

How to create a rxJS subscription with a dynamic array?

There is a function that would get called from anywhere within the application, which would be passed an object. What we need to do, is call a backend API with this item as Post Body. However, what I would like to do is collate these updates for an…
Roshan Khandelwal
  • 953
  • 1
  • 11
  • 17
1
vote
2 answers

Multiple times method calling from angular template

I am using method inside a template to call the function, that returns boolean value. The issue is that the function is called more than 6 times. After that I used changeDetectionStrategy.onPush which reduced the calls to 2 times. Below is my…
1
vote
1 answer

Check the array value exist in subscribe angular10

Am having some const array values and i have the response value in subscribe and i want to check whether the const array value is availabe in response.i dont know how to use map and filter in subscribe. if the value is available then the checkval…
1
vote
1 answer

Angular 10 call finalize() when nested observables complete

finalize nested observables after the last item is processed. Stackblitz finalize() should be called when the observables complete - all the numbers (11, 12, 13) are output. How should the observables be nested? import { from } from "rxjs"; import {…
dak
  • 339
  • 6
  • 21
1
vote
1 answer

How to merge two observables in Angular/RxJS?

In my service I have these methods: getMap(): any { return this.http.get(`someURL`); } getAssets(): any { return this.http.get(`someURL`); } In my Component I use them like this: ngOnInit() { …
Codehan25
  • 2,704
  • 10
  • 47
  • 94
1
vote
1 answer

RxJS array of HTTP observables: fire next only after previous completes

I have an array of observables (HTTP POST requests) that I need to send off to an API after a specific event. The following is a simplified example of the approach, where I use concat so I can leverage success, error and complete callbacks. // build…
Nathan Beck
  • 1,152
  • 14
  • 23
1
vote
1 answer

Return Observable from ngrx store pipe selector

I have a ngrx store selector: export const selectActivePracticeUsersListSnapshot = pipe( select(selectPracticeUsersList), filter((users) => !!users), take(1), map((users) => users.filter((user) => user.active)) ); I have a service that is…
mycroft16
  • 785
  • 10
  • 28
1
vote
2 answers

Why I obtain this error? Property 'map' does not exist on type 'Observable'

I am working on an Angular application implementing an AuthGuard class to avoid that a not logged user can access to a protected page. Following an online course I have done: import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596