MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / close

Function close

app/utils/stream.ts:37–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36 let closed = false;
37 const close = () => {
38 if (closed) return;
39 closed = true;
40 unlisten && unlisten();
41 writer.ready.then(() => {
42 writer.close().catch((e) => console.error(e));
43 });
44 };
45
46 if (signal) {
47 signal.addEventListener("abort", () => close());

Callers 1

fetchFunction · 0.70

Calls 2

errorMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected