INNER CODE UNIT · TypeScript
unlistenDispose
enisdenjo/graphql-sse · src/client.ts:387
const unlistenDispose = client.onDispose(() => connCtrl.abort());
connCtrl.signal.addEventListener('abort', () => {
unlistenDispose();
conn = undefined;
});
const opts = options as ClientOptions<true>;
const url =
typeof opts.url === 'function'
? await opts.url(undefined)
: opts.url;
if (connCtrl.signal.aborted)
throw new Error('Connection aborted by the client');
const headers =
typeof opts.headers === 'function'
? await opts.headers(undefined)
: opts.headers ?? {};