362 questions
1
vote
1
answer
46
views
How to prevent RxJS to stop pipeline execution on the first exception
I'm trying to make 3 sequential GET requests using RxJS ajax operator. If one of the ajax requests throws an error(404 status code, for example), the rest won't execute. Is it possible pipeline to ...
1
vote
2
answers
67
views
Prevent last emission - causes duplicate message
I need the LAST emission to call signals.onResponse(), thus the tap, so that my deep chat ui completes and re-enables the submit button after last message. I have to hack deep chat and use the ...
2
votes
2
answers
105
views
Waiting for all async requests to complete with concatMap
assuming that there are multiple ajax requests that need to execute one by one sequentially, the next one should be called when the previous is done. I can achieve that by using the concatMap RxJs ...
1
vote
1
answer
31
views
http poller using rxjs timer and waitUntil doesn't work
With rxjs 7.5.7, I return a promise when a polling http request will finally returns true after several false values, but takeUntil used is never called again.
I tried to following code:
return timer(...
0
votes
2
answers
131
views
takeUntil() after a filter() behaves differently from take(n) in pipe
Edit(26th September) :
this.activatedRoute.queryParamMap
.pipe(
// activatedRoute.queryParamMap emits null values first. So let's avoid it
filter((paramMap) => paramMap &&...
0
votes
0
answers
50
views
Rxjs : switchMap() with combineLatest() returns only one Observable inspite of inputting multiple Observables
I try to learn Rxjs by coding below example.
example is for accessing userinfo with usage pipe operator.
const rxjs =require('rxjs');
const { Observable, fromEvent, switchMap, take, pipe, map, ...
1
vote
1
answer
68
views
Custom error handler pipe operator function for RxJS
My goal is to create a new custom RxJS pipe operator which can handle every input like this
constructor(private errorHandler: ErrorHandlerService) {
const voidStream$ = of() as Observable<void>...
3
votes
2
answers
366
views
2 observables declared with takeUntilDestroyed, when combined, require additional takeUntilDestroyed?
I'm using takeUntilDestroyed to manage my subscriptions and avoid memory leaks. Within an injection context, variable declaration, I will have something like this
mySubject1$ = new BehaviourSubject<...
1
vote
1
answer
71
views
Is there an operator to do a "tap only if" in RxJS? A conditional tap action
observable.pipe(
tap((booleanValue) => {
if (booleanValue) {
doSomething();
}
}),
)
Is there a best practice or a better way to do this?
I don't want to filter because the data ...
1
vote
1
answer
57
views
How to Skip the First Value of Stream Except if It is a Copy Paste With RxJS?
I am currently using skip(1) to avoid unnecessary calculations when the first value is typed. However, I discovered that my users frequently use copy-paste to filter data. As a result, skip(1) skips ...
0
votes
2
answers
38
views
rxjs pipeable operator to be triggered on subscription
In rxjs, given any Observable we can do observable.pipe(finalize(() => some_cleanup()) to run some_cleanup in any case (error or completion).
I was wondering if there is the errrr.... opposite of ...
-1
votes
2
answers
111
views
RxJS Make API calls if the max batch size is reached or there is no new input for more than a specified time period using Subject,bufferSize,takeuntil
I am working on an angular application.
Instead of making an API call for every record, I want to make API calls for a batch of items after a certain time period when there are no new items being ...
0
votes
1
answer
92
views
Timeout stops stream rxjs Angular
Hi i want to keep getting data even after the timeout its reached i try some other way but no success (timeWith, repeatWhen ect)
here my code. now, any help would be good
goal: Device stops sending ...
2
votes
2
answers
368
views
Angular: how to use pipe with Location
In Angular, Location is "A service that applications can use to interact with a browser's URL."
It offers a getState() method which providers "the current state of the location history&...
1
vote
0
answers
153
views
RxJS scan and filter vs bufferCount issue
I encountered a problem when playing with ngrx effect and rxjs. I am using two versions of effect (simplified for purpose of this question):
Version 1:
public effect$ = createEffect(() =>
this....