Skip to content

Commit 956ec96

Browse files
author
Mihail Klimin
committed
fix(types): improve typings in stream.ts
- Replace generic Function type with specific () => void for unlisten - Enhance typing for setRequestId from Function to ((value: number) => void) - Address code review feedback from Biome linter
1 parent 8fa7c14 commit 956ec96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/utils/stream.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export function fetch(url: string, options?: RequestInit): Promise<Response> {
3030
headers: _headers = {},
3131
body = [],
3232
} = options || {};
33-
let unlisten: Function | undefined;
34-
let setRequestId: Function | undefined;
33+
let unlisten: (() => void) | undefined;
34+
let setRequestId: ((value: number) => void) | undefined;
3535
const requestIdPromise = new Promise((resolve) => (setRequestId = resolve));
3636
const ts = new TransformStream();
3737
const writer = ts.writable.getWriter();
@@ -66,7 +66,7 @@ export function fetch(url: string, options?: RequestInit): Promise<Response> {
6666
close();
6767
}
6868
}),
69-
).then((u: Function) => (unlisten = u));
69+
).then((u: () => void) => (unlisten = u));
7070

7171
const headers: Record<string, string> = {
7272
Accept: "application/json, text/plain, */*",

0 commit comments

Comments
 (0)