@assistant-ui/react-edge
Advanced tools
Comparing version
@@ -44,3 +44,9 @@ // src/edge/EdgeModelAdapter.ts | ||
const headersValue = typeof this.options.headers === "function" ? await this.options.headers() : this.options.headers; | ||
abortSignal.addEventListener("abort", () => this.options.onCancel); | ||
abortSignal.addEventListener( | ||
"abort", | ||
() => { | ||
if (!abortSignal.reason?.detach) this.options.onCancel?.(); | ||
}, | ||
{ once: true } | ||
); | ||
const headers = new Headers(headersValue); | ||
@@ -47,0 +53,0 @@ headers.set("Content-Type", "application/json"); |
{ | ||
"name": "@assistant-ui/react-edge", | ||
"description": "The legacy edge runtime for assistant-ui", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"license": "MIT", | ||
@@ -58,3 +58,3 @@ "type": "module", | ||
"@assistant-ui/x-buildutils": "0.0.1", | ||
"@assistant-ui/react": "0.10.9" | ||
"@assistant-ui/react": "0.10.10" | ||
}, | ||
@@ -61,0 +61,0 @@ "publishConfig": { |
@@ -125,3 +125,9 @@ import { toCoreMessages } from "../converters/toCoreMessages"; | ||
abortSignal.addEventListener("abort", () => this.options.onCancel); | ||
abortSignal.addEventListener( | ||
"abort", | ||
() => { | ||
if (!abortSignal.reason?.detach) this.options.onCancel?.(); | ||
}, | ||
{ once: true }, | ||
); | ||
@@ -128,0 +134,0 @@ const headers = new Headers(headersValue); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
165419
0.23%3055
0.39%