Answers for "emitting event on socket.io using async await"

0

emitting event on socket.io using async await

async function doesSocketAgree(){
  await new Promise(resolve => {
    socket.emit('doesOtherSocketAgree', otherSocketId, (answer) => {
      resolve(answer);
    });      
  });
}
Posted by: Guest on June-20-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language