Replies: 1 comment
-
Yes, that will cause an infinite loop. Doing
...
}).subscribe(({ data }) => {
this.setSessions([...this.sessionsSubject.getValue()??[], data!.sessionCreated]);
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have websocket server and Apollo client/server and RxJS to detect changes in my environment. And a service which subscribes users to that websocket:
// SessionService
If a new session is added the
sessionOperations.CREATE_SESSION_SUBSCRIPTION
query is called which I subscribe to. In the subscribe I want to update the sessions with the newly created session.But I think this is causing an infinite loop. Since this also updates the
sessions$
observable which runs the adding of a session again.Beta Was this translation helpful? Give feedback.
All reactions