All Questions
248 questions
1
vote
3
answers
149
views
Monitoring API Response from angular
I'm trying to monitor an api response to know if the user is currently logged in or not. To do so, I'm sending a get request to /api/status along with the http-only cookie. the endpoint should respond ...
8
votes
2
answers
12k
views
How to compute Angular signal from Observable?
I have started to slowly embrace the new Angular's Signal in my projects. I stumbled upon the following scenario, and while it works, I wonder if this is the "Angular way" of doing it.
In my ...
3
votes
3
answers
384
views
Is this angular component implemented in a reactive way?
I'm starting with reactive programming and I have the following application:
The three dotted items is a <ul> tag. Each time a li item is clicked, the app navigates to a route using the ...
1
vote
2
answers
151
views
RXJS dependent observables
I have 3 observables:
query$: Observable<string> = this.q$.pipe(tap(() => this.page$.next(0));
filter$: Observable<number> = this.f$.pipe(tap(() => this.page$.next(0));
page$ = new ...
0
votes
1
answer
63
views
How to subscribe while creating an observable?
I have an observable emitting an ID. I want to retrieve an element with that Id and store it into a new observable. However, this observable needs to be subscribed to in order to emit its value. ...
2
votes
0
answers
56k
views
RxJS websocket how to resubscribe listening to the events when socket reconnects
I have created an angular service for websocket using RxJS.
I have handled the ping/pong and also reconnecting using retry operator
my Websocket Service looks like
export class SocketService ...
0
votes
1
answer
134
views
How to subscribe after unsubscribe?
I have an angular service with three attributes and two functions:
timerSubscription: Subscription;
pollingSubscription: Subscription;
incrementTimerSubscription: Subscription;
async startTimer(...
0
votes
3
answers
185
views
Initialize a Behavioursubject with a function call
I have an angular service that is supposed to send data to 2 components that display it simultaneously and both can change that data which changes the display of it on both components. I have chosen ...
0
votes
1
answer
124
views
SwitchMap from one outer observable to multiple innser observables
I have a method which makes a http request to delete all records and then makes another http request to add a new record, for each record in the records array (I am not expecting the below code to ...
1
vote
3
answers
969
views
Toggling value of behavior subject without using getValue
I want to toggle the boolean value of my behavior subject. I'm currently achieving this by using the Behavior Subject's getValue() method. This isn't ideal as I'm effectively taking my reactive, ...
0
votes
1
answer
1k
views
How to get current initial value of Angular form control using RxJs
I have a situation where I need to listen to the value of the form control from a different component. the valueChanges does this just fine for any changes in the dropdown. However I get a null upon ...
3
votes
3
answers
3k
views
Reactive Loading state management with RxJs
A classic task when you have some input field and you have to fetch something on values changes. Let's imagine we use Angular Reactive Forms. Example:
orders$ = inputControl.valueChanges.pipe(
...
0
votes
1
answer
67
views
RXJS, Is there a way to wait inside an operator for a subscription to end before continuing the workflow?
So, i am new to RXJS, and i have checked a lot of stackoverflow and documentation before coming here and asking this, but i'm finding a hard time to make my logic work.
I have an Observable that will ...
0
votes
1
answer
123
views
Using RxJs/Reactive programming - how can I get a related entity?
I have two entities: Organization and User. In my component, I have access to the currently authenticated user like this:
// component.ts
public authenticatedUser$ = this._authService....
0
votes
0
answers
53
views
retryWhen barred in VSCode
Hello I have the retryWhen pipeable function barred in VScode, it seem like a deprecated method, do you have any idea about this: