Add API for propagating cursor locations (#61)

This commit is contained in:
Andras Schmelczer 2025-06-08 20:20:52 +01:00 • committed by GitHub
commit e8b9bf40c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,7 +51,10 @@ export class ConnectionStatus {
logger: Logger,
fetch: typeof globalThis.fetch = globalThis.fetch
): typeof globalThis.fetch {
return async (input: RequestInfo | URL): Promise<Response> => {
return async (
input: RequestInfo | URL,
init?: RequestInit
): Promise<Response> => {
while (!this.canFetch) {
await this.until;
}
@ -63,7 +66,7 @@ export class ConnectionStatus {
? input.clone()
: input;
const fetchPromise = fetch(_input);
const fetchPromise = fetch(_input, init);
// We only want to catch rejections from `this.until`
let result: symbol | Response | undefined = undefined;