Abdullahrasheed45 commited on
Commit
4464c3c
·
verified ·
1 Parent(s): 0c124a5

Create useVLMContext.ts

Browse files
Files changed (1) hide show
  1. src/context/useVLMContext.ts +9 -0
src/context/useVLMContext.ts ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import { useContext } from "react";
2
+ import { VLMContext } from "./VLMContext.ts";
3
+ import type { VLMContextValue } from "../types/vlm";
4
+
5
+ export function useVLMContext(): VLMContextValue {
6
+ const ctx = useContext(VLMContext);
7
+ if (!ctx) throw new Error("useVLMContext must be inside VLMProvider");
8
+ return ctx;
9
+ }