Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/react

Package Overview
Dependencies
Maintainers
0
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/react - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

6

CHANGELOG.md
# @ai-sdk/react
## 0.0.15
### Patch Changes
- 6c99581e: fix (ai/react): stop() on useObject does not throw error and clears isLoading
## 0.0.14

@@ -4,0 +10,0 @@

17

dist/index.js

@@ -702,2 +702,3 @@ "use strict";

// src/use-object.ts
var import_provider_utils2 = require("@ai-sdk/provider-utils");
var import_ui_utils4 = require("@ai-sdk/ui-utils");

@@ -727,4 +728,9 @@ var import_react4 = require("react");

var _a;
(_a = abortControllerRef.current) == null ? void 0 : _a.abort();
abortControllerRef.current = null;
try {
(_a = abortControllerRef.current) == null ? void 0 : _a.abort();
} catch (ignored) {
} finally {
setIsLoading(false);
abortControllerRef.current = null;
}
}, []);

@@ -735,2 +741,3 @@ const submit = async (input) => {

setIsLoading(true);
setError(void 0);
const abortController = new AbortController();

@@ -755,3 +762,3 @@ abortControllerRef.current = abortController;

let latestObject = void 0;
response.body.pipeThrough(new TextDecoderStream()).pipeTo(
await response.body.pipeThrough(new TextDecoderStream()).pipeTo(
new WritableStream({

@@ -774,4 +781,6 @@ write(chunk) {

);
setError(void 0);
} catch (error2) {
if ((0, import_provider_utils2.isAbortError)(error2)) {
return;
}
setError(error2);

@@ -778,0 +787,0 @@ }

{
"name": "@ai-sdk/react",
"version": "0.0.14",
"version": "0.0.15",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -0,1 +1,2 @@

import { isAbortError } from '@ai-sdk/provider-utils';
import {

@@ -104,4 +105,9 @@ DeepPartial,

const stop = useCallback(() => {
abortControllerRef.current?.abort();
abortControllerRef.current = null;
try {
abortControllerRef.current?.abort();
} catch (ignored) {
} finally {
setIsLoading(false);
abortControllerRef.current = null;
}
}, []);

@@ -112,2 +118,3 @@

setIsLoading(true);
setError(undefined);

@@ -138,3 +145,3 @@ const abortController = new AbortController();

response.body.pipeThrough(new TextDecoderStream()).pipeTo(
await response.body.pipeThrough(new TextDecoderStream()).pipeTo(
new WritableStream<string>({

@@ -161,5 +168,7 @@ write(chunk) {

);
} catch (error) {
if (isAbortError(error)) {
return;
}
setError(undefined);
} catch (error) {
setError(error);

@@ -166,0 +175,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc