Questions tagged [rxjs]
The Reactive Extensions for JavaScript (RxJS) is a set of libraries for composing asynchronous and event-based programs.
51 questions
2
votes
1
answer
286
views
Efficient browser `StorageEvent` handling
I have this class EfficientStorageEventProvider, which is responsible for efficient handling of StorageEvent
...
1
vote
1
answer
158
views
Convert from get response to array of type
I would like to know if this is the best/most efficient/industry standard way of converting from the http response to an array of typed values:
Type class:
...
-1
votes
1
answer
1k
views
If condition in combineLatest observables [closed]
I have many observables so I use combineLatest in RxJS. After get all results I need to check one of value by using if condition. If the condition meets then call ...
1
vote
1
answer
97
views
Typescript error handler
I wrote a function in Typescript which takes required parameters, optional parameters and parameters with default value. I want to use this function for error handling of http requests. I am not sure, ...
6
votes
1
answer
3k
views
Custom RxJS operator to prevent duplicate API calls in Angular
I have a usecase where I want to prevent unexpected duplicate Http calls. I'm wondering if I can have a custom operator which can be used in pipe for any API as shown in below ...
1
vote
2
answers
159
views
how to avoid nested asynchronous subscriptions in RxJS?
I got this two subjects that both have a delay and I need the second one to be subscribed when the first one is completed, asynchronously. Both subjects only emit once (http requests) and I'm trying ...
0
votes
1
answer
93
views
A custom RxJS operator which emits (and completes) once a condition has been satisfied for all previous values of the source
The code is written in TypeScript.
...
2
votes
1
answer
207
views
Rxjs search in Angular
I created an rxjs search for a hiring company, but I got rejected for the following reason:
-performance issue on a bigger data set.
-bugs
My question is how can I make this code better for the next ...
0
votes
1
answer
338
views
RxJs - Flat nested swithMaps and pass variables on Http interceptor
How can the following method be flattened? I tried to pipe all the operators to the first pipe (from(this.fireAuth.currentUser)) but I lost access to the previous ...
0
votes
1
answer
1k
views
Handling a spinner for multiple REST calls
Context
In an Angular application, I have three <select> boxes that are fed from the database with a relatively small data set. These boxes are part of a ...
4
votes
2
answers
3k
views
Angular10 RxJS - Interceptor to add/refresh JWT Token
I have a project, for which I use Tokenauthentication with JWT Tokens. I am relatively new to Angular Development and rxjs in particular, so there are a lot of concepts I am likely not yet familiar ...
2
votes
1
answer
2k
views
Rewrite BehaviorSuject that takes either localStorage or Observable in Angular
I have this code
...
0
votes
1
answer
866
views
Refactor multiple if condition in JavaScript/TypeScript
I want to refactor this code but am wondering how I should start it. I'm not sure this code is totally against clean code or not. I'm thinking to use RxJS or a JavaScript builtin method. I'd like to ...
1
vote
1
answer
5k
views
Merge the multiple observables responses into a single array
Here's what I trying to do:
Given a paginated API, get all the resources using parallel requests.
The API returns a limited number of resources per call. So, you need to use an offset parameter to get ...
2
votes
0
answers
57
views
Switching article states using state pattern
The Article model supports a bunch of transitions. Only two are shown below: star()/unstar()....