Answer the question
In order to leave comments, you need to log in
How to wait for a subscription to a websocket event?
There is a constructor
const socket = io();
socket.on('some event', cb);
getDataToSomeEvent();
Answer the question
In order to leave comments, you need to log in
No way. This is an event model of interaction. It has no concept of order.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question