Answer the question
In order to leave comments, you need to log in
How to properly pull the observer from another method?
Roughly speaking, there is a login method that sends a command to the websocket, after the response in onMessage, the Observable needs to work. i.e. subscribe worked or error.
I really don’t want to use EventEmitter, but as I understand it, it’s not entirely correct to take out observers
Answer the question
In order to leave comments, you need to log in
You show the code, it is not entirely clear what you are going to pull and why.
You don’t need to pull the observer, you need to emit the value in the observable, and the observer must be subscribed to it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question