@umituz/react-native-ai-gemini-provider 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-gemini-provider",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Google Gemini AI text generation provider for React Native applications",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -4,7 +4,7 @@
4
4
  * Supports text, structured JSON, and multimodal generation
5
5
  */
6
6
 
7
- import { useState, useCallback, useRef, useMemo } from "react";
7
+ import { useState, useCallback, useRef, useMemo, useEffect } from "react";
8
8
  import type { GeminiGenerationConfig } from "../../domain/entities";
9
9
  import { DEFAULT_MODELS } from "../../domain/entities";
10
10
  import { geminiTextGenerationService, geminiStructuredTextService } from "../../infrastructure/services";
@@ -93,5 +93,9 @@ export function useGemini(options: UseGeminiOptions = {}): UseGeminiReturn {
93
93
  setError(null);
94
94
  }, []);
95
95
 
96
+ useEffect(() => {
97
+ return () => { abortRef.current = true; };
98
+ }, []);
99
+
96
100
  return { generate, generateWithImage, generateJSON, result, jsonResult, isGenerating, error, reset };
97
101
  }