Skip to main content

awaitConnected

Returns a promise that resolves when transport is connected. Resolves immediately if already connected.

async
moopsyClient.
transport.
awaitConnected
()
async-function
()
Arguments
None
=>
Returns
Promise
<void>

Usage

async/await

await moopsyClient.transport.awaitConnected();

// Do something that requires server connection...

Promise.then

void moopsyClient.transport.awaitConnected().then(() => {
// Do something that requires server connection...
});