Questions tagged [rxjs-observables]

759 questions
0
votes
1 answer

Angular/RxJS update piped subject manually (even if no data changed), "unit conversion in rxjs pipe"

I am working on an app using Angular 9 and RxJS 6.5. The functionality I have problems with uses Angular services to fetch some data from a server and provides this data to views (using RxJS behaviorSubjects). Before passing that data to the views…
0
votes
2 answers

Why is my RXJS epic in an infinite loop on mount but only called once on button click?

please take a look at this code below basically what is happening my action is being dispatched here: useEffect(() => { fetchData() setLoaded(true) }, []) but for some reason this is infinite looping and causing my action to…
Red Baron
  • 7,181
  • 10
  • 39
  • 86
0
votes
0 answers

" observable$ | async " failing with HttpClient observables, but succeeding with for operator

I followed a tutorial about dynamic forms (https://angular.io/guide/dynamic-form) and everything worked just fine untill I tried to retrieve the data from an HttpClient. The problem: @Input() questions: QuestionBase[] = [];in…
0
votes
1 answer

Combine two observables inside pipe() chain

I'm using Rxjs, and I want to create an Observable from the following pattern (in order): get params from paramMap$, then ... based on the value of params, get both (getData():Observable, getCategories():Observables) together, then .... from…
Sh eldeeb
  • 1,589
  • 3
  • 18
  • 41
0
votes
1 answer

AngularFireFunctions httpCallable not updating after response

Using an Observable from AngularFireFunctions' httpsCallable, the view never updates with the value even after the http request returns. I have a simple component that uses AngularFireFunctions to make an httpCallable to a simple function. I can see…
Keith
  • 2,958
  • 4
  • 26
  • 29
0
votes
1 answer

Implementing permission directive won't update view until page refresh

I have created a directive to show/hide element according to permission. Implementation of directive is somehow like: Directive code is: import { Directive, …
0
votes
0 answers

How to implement reactive programming in angular with Observable store state management?

I am using @CodeWithDan/Observable store package for state management. However while started to play with it, there was no help on how to have a reactive programming using the observable stores. Is there any help links out there to get an idea on…
0
votes
1 answer

Angular: are nested async pipe usage safe?

I couldn't find any documentation related to this, so here it is. I have this usage of async pipe in a template: Is aliases$ subscription correctly unsubscribed when users$ emits?…
petronius
  • 451
  • 3
  • 11
0
votes
3 answers

Angular route guard/resolver - Type 'Observable' is not assignable to type 'Observable'

I am using a route guard (or resolver, I have tried to use either but got the same error) where I want to get Observable as a return value: canActivate(): Observable { return this.store.pipe( …
0
votes
1 answer

What is the best practice to share data in map/object/array by service among Angular components

I am studying angular now. When it comes to data sharing using service, many are recommending that we should use Subject like BehaviorSubject. But should we do it all the time? @Injectable({ providedIn: 'root' }) export class DataService { …
Leo Y
  • 23
  • 4
0
votes
1 answer

Confusion using Observable.switch

The switch documentation on github contains an example on how to use the command. var source = Rx.Observable.range(0, 3) .select(function (x) { return Rx.Observable.range(x, 3); }) .switch(); var subscription = source.subscribe( function (x) { …
user35934
  • 374
  • 2
  • 13
0
votes
1 answer

Display data based on routing on the first component from the second component

I have 2 components on my app: filters-component and card-component. On the filters-component I added a routing method for data filtering based on country selector anchor. Filters-component: import { Component, OnInit } from…
0
votes
2 answers

Is it necessary to subscribe and remove observables it in these cases?

I'm here thinking about observables .. And I imagined the following situations: Example 1) In my case when I use NGRX I create all the architecture correctly, and I create a selector service for that particular store. In the service it is not…
user11472365
0
votes
1 answer

How to complete combineLatest?

I use combineLatest to get latest values from each observables: combineLatest$ = combineLatest(_block$, _field$); combineLatest$.subscribe(() => { console.log("Completed..."); }); Then I have another observable that works until…
user13295902
0
votes
1 answer

Bulk data call using RXJS in nodejs

I want to send a bulk of data and after completing it, want to move to the next one. For example: I have this function: async function test() { await sample.sampleStructure() await sample.sampleDataAdd() await sample.sampleDataGet() } Where…
lazysnoozer
  • 85
  • 11