MCPcopy Create free account
hub / github.com/MathMan05/Fermi / constructor

Method constructor

src/webpage/utils/progessiveLoad.ts:8–21  ·  view source on GitHub ↗
(url: string, req: RequestInit = {})

Source from the content-addressed store, hash-verified

6 sizeLeft = 0;
7 ready: Promise<void>;
8 constructor(url: string, req: RequestInit = {}) {
9 this.controller = new AbortController();
10 this.ready = fetch(url, {
11 ...req,
12 signal: this.controller.signal,
13 }).then(async (f) => {
14 if (!f.ok || !f.body) {
15 throw new Error("request not ok");
16 }
17 const read = f.body.getReader();
18 this.cbuff = (await read.read()).value;
19 this.read = read;
20 });
21 }
22 async next() {
23 return (await this.get8BitArray(1))[0];
24 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected