Questions tagged [rxjs-observables]

759 questions
1
vote
2 answers

How do I use RxJS & Observables to do an http request only after multiple other events have fired?

I am having trouble combining the emitted values of two different Observables for use in an http request, and then returning the request's Observable for use by clients. Some background: I am working on a Twitch extension. Part of their ecosystem is…
lettucemode
  • 422
  • 4
  • 14
1
vote
1 answer

Using Angular Async Pipe to Subscribe to Observable

I am successfully subscribing to an observable in a couple of different components in my Angular/Ionic app. However, because I am doing so manually, that also means I need to manually unsubscribe to them, which I currently do in my ngOnDestroy()…
Rey
  • 1,393
  • 1
  • 15
  • 24
1
vote
1 answer

Can I create a brand new stream from the existing stream in rxjs

For Example, I have a stream a number of numbers say 1,2,3,4 and so on. I want to sense each of these data and whenever it's even I want to emit true in another data stream. keeping the source data stram[1,2,3,4] as is.
Sudhir Kumar
  • 163
  • 2
  • 15
1
vote
2 answers

Angular dynamically filter RxJS observable with multiple condition

I want to achieve dynamic client side filtering with data from Angular FireStore. I've the following service, which is working more or less, but it's really verbose and I think it can be improved. My problem is with the filteredFiles$ part, I think…
Balu
  • 398
  • 6
  • 15
1
vote
1 answer

How to modify inner element of each Object emitted by observable before returning the outer observable

I am new to the whole concept of Observables and rxjs so this might be very obvious. But please help as I am desperate to learn I have a funtion when a user clicks to show comments under a blog post showComments(){ …
1
vote
3 answers

How to return result of inner observable in route resolver Angular

I am trying write what seems like a simple method to fetch a users profile details for my Angular app and load that data before navigating to the profile page using a resolver. . The resolver doesn't complete even though there a no errors This is my…
1
vote
1 answer

behaviorSubject next() not working angular 8

I have a HeaderComponent which displays the header in which I have a search bar, where a user when inputs something and presses enter I take the user to SearchComponent. I want to implement the functionality that when a user is on search page…
1
vote
0 answers

Multiple subscriptions to the same Behaviour Subject observable / datasource in Angular 8 intermittently fails

I have a data store implementation that is shared among a lot of instances of the same component. I am subscribing to the observable of the store's datasource which is a behavior subject at all of these different component instances. I am passing…
1
vote
1 answer

How to convert Observable to Observable[] without subscribe?

In my current angular project I have a service that returns Observable. I would like to convert that stream to an array of Observables of single Product. I want to achieve this using pipe operators, without subscribing to the original…
1
vote
1 answer

Angular V9 Async pipe not updating template view on data change

I'm pretty much a standstill with this now guys. I'm using a small service to get the details from an API, returning a JSON object. I am returning this as an Observable from the service method; then initialising the local component variable…
1
vote
2 answers

Keeping error information and the outer observable alive

To ensure an error doesn't complete the outer observable, a common rxjs effects pattern I've adopted is: public saySomething$: Observable = createEffect(() => { return this.actions.pipe( …
Jack
  • 10,313
  • 15
  • 75
  • 118
1
vote
1 answer

showing by console.log an observable array in angular 8

I am trying to show response from an observable on console that comes from a service in my angular project. But it appears to be undefined. When I try with a loop, the error in console says it is not iterable while the observable is supposed to…
Graham
  • 11
  • 1
  • 4
1
vote
1 answer

Angular observables never come to completion handler

Below is my code snippets. I wonder why it NEVER run into the completion handler? What I wanted to do is, first call serviceA to get objectA with given route param['key'], and then call serviceB to get objectB. So, objectB depends on result of…
Angus
  • 31
  • 4
1
vote
3 answers

rxjs share with interval causes issue when waiting for next interval iteration

I'm new to RxJs and need help/understanding for the following. I have page that displays current covid cases. I have it setup to poll every 60 seconds. What I'm trying to understand is, if I subscribe to this observable via another new component, I…
KingKongFrog
  • 13,946
  • 21
  • 75
  • 124
1
vote
2 answers

Rxjs create an observable that emits when a function is called

I'm likely missing something simple but can't quite puzzle this out from the docs. I'd simply like to have a function that when called will emit a value on an rxjs observable. Psuedocode: const myFunction = () => true //or whatever value const…
imagio
  • 1,390
  • 2
  • 16
  • 27