Questions tagged [rxjs-observables]

759 questions
1
vote
1 answer

Angular 11: trying to assign values to an object using combineLatest

I have been struggling with this all day long. I have a component with an interface called Invoice and I need to assign values to some of the fields so I can pass the invoice object to a service to save to database. I normally program more…
John Chandler
  • 153
  • 1
  • 8
1
vote
1 answer

Angular Async Pipe and the 'delay' operator

I'm attempting to simulate latency with my observables. I want to unwrap the observable using the async pipe, and add a bit of delay with the 'delay' operator. app.component.html
1
vote
1 answer

Get error while using extend-chrome/messages while sending messgae from background script to content script

I am using this library for messaging. I have my background script like this import { sendUrlInfo, waitForUrl } from 'utils/messaging'; import URL from 'url-parse'; chrome.webNavigation.onHistoryStateUpdated.addListener((details) => { const url =…
1
vote
1 answer

RxJS combineLatest: Unable to merge with latest values in Angular 12

I have 3 filter values (select boxes basically). When there is a selection change, I want to fire a combined API call along with other filter values selected previously (using BehaviorSubject for each filter). Unfortunately, in the 'combineLatest' I…
1
vote
0 answers

Angular Observable not working with another API call

Below code with one api request is working fine. But instead of find in forEach loop, want to get data from another API call, which is not working as it return the values from function and response received later on, as a result view not getting…
1
vote
2 answers

RxJs - can't create two new Observables from merged one

I'm stuck here right now I hope someone can help me :-) following scenario: I have two streams which transfer the same data type. The first stream provides initial data (REST call) and completes afterwards. The second stream gets its data via…
1
vote
1 answer

Using observables in react-query

I am building out an app and planning to use rxjs for Observables. However, I like react-query cache functionality and would like to merge them together to get it working. I am facing an issue where the error code is not clear to me. Please…
arunmmanoharan
  • 2,535
  • 2
  • 29
  • 60
1
vote
2 answers

Rxjs Repeat Until items to process is zero

I have an endpoint which receives an array of ids to do some processing. The backend dev, asked me to send only 10 ids during rushhour, and 50 outside them. The user enters in a field, all the ids they want to process (top 100). What I need to do…
1
vote
1 answer

Using RXJS like a cascaded forEach loop?

How is it possible with RXJS to make a cascaded forEach loop? Currently, I have 4 observables containing simple string lists, called x1 - x4. What I want to achieve now is to run over all variation and to call a REST-Api with an object of variation…
Lars
  • 920
  • 1
  • 14
  • 34
1
vote
1 answer

Are there RxJS operators that modify the observable?

This question is for learning purposes, not to solve a particular problem (please move it to the appropriate section if necessary). I'm learning about piping operators in the RxJS library. At this site here (https://rxjs.dev/guide/operators) it…
gib65
  • 1,709
  • 3
  • 24
  • 58
1
vote
0 answers

Angular 6 how to pass the parameter returned from parent to child call back method

Defined a callback function definition in child private ModalNextAction: (callback?:(isUpdated: boolean) => void) => void; its call back is defined as below. Parent returns if a modal can be opened or not canOpenModalDialog()…
GANI
  • 2,013
  • 4
  • 35
  • 69
1
vote
1 answer

Updating value of an observable without applying the subscribe

I subscribe to an Observable with a pairwise pipe in order to get previous and new value. But sometime I would like to tell the Observable that the value has been updated without applying the subscribe function. It will ensure that the previousValue…
MHogge
  • 5,408
  • 15
  • 61
  • 104
1
vote
1 answer

How to use RXJs Subject like store variable in Svelte

How to use RXJs Subject like store variable in Svelte? You can use the Subject variable in Svelte with $ prefix. But when you bind the variable to input it throws an exception: "Error: name.set is not a function" because the Subject type has not a…
cacheoff
  • 251
  • 3
  • 5
1
vote
1 answer

BehaviorSubject doesn't emit values

i have a problem with emiting values from behavior subject after switchMap operator from parent to child component. If i call real http API in console.log in child compoennt i only see empty array [] (default value), but in tap operator in parent…
Tom
  • 77
  • 7
1
vote
1 answer

undefined when combine combineLatest and switchMap

I'm trying to combine two Observables to have few values for the call to service method that accepts two values. But here I have few errors Argument of type '([filter, sort]: [string, string]) => void' is not assignable to parameter of type…