INNER CODE UNIT · TypeScript
getOrConnect
enisdenjo/graphql-sse · src/client.ts:367
async function getOrConnect(): Promise<NonNullable<typeof conn>> {
try {
if (client.disposed) throw new Error('Client has been disposed');
return await (conn ??
(conn = (async () => {
if (retryingErr) {
await retry(retries);
// connection might've been aborted while waiting for retry
if (connCtrl.signal.aborted)
throw new Error('Connection aborted by the client');
retries++;
}
clientOn?.connecting?.(!!retryingErr);