Questions tagged [rxjs5]

The 5th version of the reactive extensions for javascript.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

Angular-Rxjs scan operator issue | re invoking all previously performed operations

I m performing crud operation on certain array in angular. I am kind of experimenting with rxjs, in order to learn it more. It is my person facade below. PersonFacade.ts private readonly ...
Ravindra Devrani's user avatar
0 votes
1 answer
23 views

rxjs 5 -> 6 migration: connect operator missing

We started upgrading rxjs from v5 to v6 (without using the compatibility layer, in case it makes any difference). The majority of the changes are straight forward and well documented in https://github....
XeniaSis's user avatar
  • 2,192
0 votes
0 answers
37 views

Angular module's provider service is acting as singleton even though that module is imported in other feature modules

As per angular document - https://angular.io/guide/singleton-services If a module defines both providers and declarations (components, directives, pipes), then loading the module in multiple feature ...
user1441238's user avatar
0 votes
0 answers
48 views

Why are my Declarative RxJS async pipe calls (success/error) showing simultaneously in my HTML?

I have two declarative RxJS calls (with an action stream) that are separate and get passed to an output component in order to be displayed in the HTML. So once I hit a button, the body from our form ...
Donald Groezinger's user avatar
0 votes
0 answers
30 views

Other method like catchError or implementation of catchError

I need to catch errors in stream inside pipe, to allow the stream continue send requests. I tries to use catch, but is runs after the stream failed and stop it. and I can't get more results from this ...
Dvora Tik's user avatar
0 votes
1 answer
59 views

How to take some of the properties of an Observable and assign them to another Observable using RxJS operators

I have an employee$ Observable and a personalInformation$ Observable. personalInformation$ is a subset of employee$ and I want to map the matching properties of employee$ to personalInformation$. The ...
eleon's user avatar
  • 173
1 vote
0 answers
56 views

How to make my newly created observable subscribers to get a boolean?

I want to make an observable that when a subscribed to emits a boolean , i tried a lot of combinations but nothing seems to work. example: let myObservable = new Observable<boolean>(item => ...
Wissam's user avatar
  • 35
0 votes
1 answer
776 views

How to import firstValueFrom function from rxjs in Angular 13?

Module '"rxjs"' has no exported member 'firstValueFrom'.ts(2305)
Rishikesh Pawar's user avatar
0 votes
2 answers
2k views

How do I combine two subscriptions in Angular?

Is there a way to combine the subscriptions for this.controls.attendanceDate and this.controls.type? I need to have access to both at the same time in order to call each of this....
Scott's user avatar
  • 2,490
0 votes
2 answers
116 views

RxJS operator equivalent of ((observableX | async) || (observableY | async)) in template

I have the following code in my component template <mat-spinner *ngIf="((facade.user.data$.isLoading | async) || (facade.product.data$.isLoading | async))"></mat-spinner> I want ...
shuffler's user avatar
-1 votes
1 answer
343 views

Call a method from inside of subscribe

Im trying to call a method from inside of subscribe in angular/ionic. But its not working. Here is my code: somemethod() { const browser = this.iab.create('https://someurl.com'); browser.on('...
Jameel's user avatar
  • 165
1 vote
1 answer
1k views

Angular: intercept an HttpResponse and make other calls before propagate the response to caller

What i'm trying to do is to intercept a response and if here is a certain value (CHALLENGE), make a call to an other API and retry it 3 times if needed, then, if success, reply the first call and ...
Andrea Scarafoni's user avatar
0 votes
0 answers
210 views

Subject import package difference

I got a warning when I serve my Angular app. depends on 'rxjs/internal/Subject'. CommonJS or AMD dependencies can cause optimization bailouts. But when I changed Subject import package.The warning ...
AlanZh's user avatar
  • 3
0 votes
2 answers
964 views

how to flatten the nested array in rxjs

I am using forkJoin to subscribe multiple inner observable. How can I flat nested array to single level array. const x$ = of([1, 2, 3, 4]); const y$ = of([2, 4]); x$.pipe( switchMap((t) => { ...
Indraraj26's user avatar
  • 1,736
1 vote
1 answer
815 views

Map behavioursubject and assign it to same variable after mapping rxjs

I have a scenario, my child component takes BehaviourSubject as Input and that(child) subscribes it internally. I need to filter/map on BehaviourSubject in the parent, so that when somewhere next() is ...
harpal's user avatar
  • 426
-1 votes
1 answer
45 views

How to get data from second stream by first?

I have tried to get data from BehSubject this.visible$ only in case when this.redraw$ happends. It works, but if the this.visible$ is changed somewhere the prev stream again works. How to avoid it? ...
user avatar
0 votes
1 answer
463 views

Swicthmap in rxjs doesnt cancel the previous request

I am basically calling an API on keyup event of a textbox using switchmap. The problem that I am facing is that switchmap doesn't cancel the previous ongoing API call when a new API call is made ...
Slow Death's user avatar
0 votes
1 answer
209 views

How can I make an Alert appear in the screen using AG Grid and Adaptable/

I created an Observable Alert in AG Grid (using Adaptable) which is correctly firing when an order is stale for 2 minutes. But I only see the Alert in the Toolbar and not as a popup notification in ...
Henders's user avatar
  • 112
1 vote
1 answer
126 views

What's the added value of using Observable over normal Array? [closed]

I've been using Observables in Angular in the state layer to store the app data and to share that data among the components of the app. With a belief, using observables, that data would passively ...
Yousef Alaqra's user avatar
0 votes
1 answer
545 views

Avoiding duplicate calls inside keyup event in angular

What i am trying to do is call a service and bind the data on ngOnit() In the given textbox, when a user types something, instead of calling API call for every letter, wait for a second, if user ...
Sharpeye500's user avatar
  • 8,795
1 vote
1 answer
379 views

debounce request on button click with angular

I'm finding it hard to implement debounce on an HTTP request with Rxjs once a button is clicked. What I'm trying to achieve is when the button is click, it should wait for x seconds before the post is ...
DevUser's user avatar
  • 31
0 votes
1 answer
44 views

Angular data not loading

Angular also goes into the "first" place when I get data from the service. However, without clicking any button on the page, it does not enter the place where I write "second". ...
Gunseli's user avatar
1 vote
1 answer
349 views

How to put custom gap between interval for polling in Rxjs angular?

I would like to implement gap / delay between every interval call, i have tried below but it seems not working. pollOnInterval(threshold = 4000): Observable<any> { let thresholdValue = ...
Vinee's user avatar
  • 1,578
0 votes
2 answers
34 views

How can i combine my RXJS expressions that represents two different logic?

Hi I am having an angular2 project. I have two rxjs expressions. how can i combine both of them . the following is my rxjs expressions. this.trafficTypeControl.valueChanges .pipe( filter(...
Starbucks Admin's user avatar
0 votes
1 answer
85 views

Issue with asynchronous angular requests

How to handle asynchronous calls in angular. I know i am getting array as undefined due to asynchronous nature but how do i solve it private fetchData(id){ var array = []; this.httpClient.get('...
AB B's user avatar
  • 1
1 vote
2 answers
730 views

RxJS group by field and return new observable

I've following interfaces and Observable<Machine[]>, what I want to achive is group by Machine symbol property in Observable<Machine[]> and return mapped observable Observable<Order[]&...
Mateusz S.'s user avatar
0 votes
1 answer
131 views

BehaviorSubject not working as expected Angular

I am trying to pass an email from accountrecovery component to password-reset component with BehaviorSubject but Im not receiving the email in password-reset component instead I get the initial value. ...
StefanP's user avatar
0 votes
1 answer
109 views

Abort promise chain upon action dispatch (rxjs)

Here is what I want to achieve: this.jobManager .queue( // start a job ) .then( // do more stuff, but abort if `ABORT` action dispatched before it finishes ) ....
chrispalmo's user avatar
1 vote
1 answer
497 views

Cancel repeated subscription in mergeMap

How to combine the distinct, switchMap and mergeMap operators, so that when the source emits repeated values (detected by distinct.keySelector), the previous subscription is canceled (as in the ...
Alex Parloti's user avatar
0 votes
1 answer
4k views

Subscribe to one observable twice from a component doesn't work

I got several components subscribing to my data service and they are all working fine. But in one of my components, I try to subscribe twice (inside ngOnInit and ngAfterViewInit) but this doesn't work....
Fth's user avatar
  • 105
1 vote
2 answers
714 views

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(...
Jek's user avatar
  • 5,556
1 vote
1 answer
145 views

How to concat multiple array observables that some might not emit any stream

Let's say I have following situation: allItems$: <(TypeA | TypeB)[]>; arr1$: TypeA[]; // [{a: 1, b: 2}, {a: 3, b: 4}] arr2$: TypeA[]; arr3$: TypeB[]; // [{ b:1, c: 2}, { b:3, c: 4}] arr4$: TypeB[...
RMontes13's user avatar
  • 2,138
0 votes
2 answers
546 views

subscribing when mouseover on particular element in the DOM

I need to subscribe & do some actions, when mouseover on particular elements in the DOM. For Example: home.component.html <div class="container"> <div ...
Yashwanth's user avatar
  • 161
1 vote
1 answer
141 views

RxJs 5 of.filter.mapTo operators -> RxJs 6

I've inherited some old RxJs 5 code that smells awkward: myFunc = (tag: TagModel): Observable<TagModel> => { try { const foundTag = this.mappedTags.find((x) => { return ...
pmont's user avatar
  • 2,092
0 votes
1 answer
229 views

rxjs : get duplicate http requests on the first set that I send

I made this functionality, each iteration i have 7 requests that sent each environment.dashboard.frequency time, but at the beginning, I see that i send 14 requests to the server instead of 7 : let ...
lior katz's user avatar
2 votes
1 answer
298 views

undefined output while using mergeMap in Rxjs

Theoretically, I know what mergeMap is and how it works, but when I try to understand using practical approach I get confused, this is what I have done so far const input1$= of("value 1",&...
Russian Federation's user avatar
0 votes
0 answers
23 views

Using RXJS 5 for Paginating a Search [duplicate]

I'm trying to paginate a search and I need to prevent it from concatenating the list of results from the previous search. Ex Search: %Dog% 1st page of results: "Dog Barks", "Dog Growls&...
millerg's user avatar
  • 25
0 votes
2 answers
2k views

How do I map a list of objects from an HTTP API to a list of strings? [closed]

I am trying to use the merge operator is given below. I want to put only 'Mr' before login but I am getting an error, your help is much appreciated, thank you let data=this.http.get('https://api....
Russian Federation's user avatar
0 votes
0 answers
150 views

RXJS Share state between merge streams

I need to make API call for get/set method. But these Service need previous state to make a next call. In this pattern, in state prop I wanted to maintain previous state of this stream so that when I ...
Rohit's user avatar
  • 1
0 votes
2 answers
225 views

How to smooth stream Rxjs?

I have a Rxjs: private loading = new BehaviorSubject(false); The loading can be changed fast from true to false. How to smooth this stream and pass values only if time between false and true is ...
user avatar
0 votes
1 answer
240 views

spyOn(Observable, 'fromEvent') throws error after upgrading to rxjs 6.5

getInactiveTimerTabSynchronizer() { return fromEvent(window, 'storage').pipe( filter((x: StorageEvent) => { return x.key === this.inactivityTabSynchronizerStorageKey; }), ...
Ashutosh Singh's user avatar
-1 votes
1 answer
24 views

How to improve Rxjs statement?

I have the following Rxjs statement: const versionsRequest2$ = (num: string) => request2$(num).pipe( map((versions) => { const p = new P(); ...
user avatar
-1 votes
1 answer
156 views

How to send requests to server one after one RxJS?

How to correctly send RxJS requests, when there are 4 different API endpoints, I need to request each endpoint until previous does not return data. Schema is: Request 1 -> Return Void Request 2 -&...
user avatar
-1 votes
1 answer
29 views

How to call forkJoin in switchOperator?

I have tried to call forkJoin in switchMap: this.route.params.pipe( pluck('cadnum'), tap((cadnum) => { this.r1.repositoryModel.findallversionbycadnum.model.cadnum = cadnum; this.r2....
user avatar
2 votes
1 answer
617 views

complicated pipe chain with the HttpClient in Angular with RxJS

I dont have a lot experience in RxJS and I want to do the following thing with a RxJS pipe in my Angular service. I tried with the iif function but I simply have not enough experience in it. Angular ...
Daniel's user avatar
  • 87
0 votes
1 answer
246 views

Creating multiple async pipes of unknown number

I am using Angular 5 and loading a list of items using a selector with my NGRX library. My selector returs a list of items which I used to dynamically create tabs on a page using the async pipe. Now, ...
james Makinde's user avatar
1 vote
1 answer
100 views

Managing subscriptions based on async event

Im looking a way to simplify this and avoid managing subscriptions inside my pipe. The general idea abought my code: this.start$ubject // waiting for users call to start .pipe( mergeMap(() =&...
Konrad Albrecht's user avatar
4 votes
1 answer
2k views

How to test with the marble approach when the returm is a EMPTY observable in effect?

I am using EMPTY from rxjs in order to handle the catchError, What is the correct value for expected in order to pass the fail scenario. import { Injectable } from '@angular/core'; import { Actions, ...
Tabares's user avatar
  • 4,093
1 vote
2 answers
175 views

How to use TypeScript in RxJs (BehaviourSubject) for strict type checking?

I am trying to create a BehaviourSubject using RxJs. Here in this code import { BehaviourSubject } from 'rxjs'; const name = new BehaviourSubject("Dog"); // Here in the subscribe callback, I am ...
Saswat Arabinda's user avatar
0 votes
1 answer
72 views

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 ...
user35934's user avatar
  • 374

1
2 3 4 5
31