/ src / hooks / useAppContext.ts
useAppContext.ts
 1  import { useContext } from "react";
 2  import { AppContext, type AppContextType } from "@/contexts/AppContext";
 3  
 4  /**
 5   * Hook to access and update application configuration
 6   * @returns Application context with config and update methods
 7   */
 8  export function useAppContext(): AppContextType {
 9    const context = useContext(AppContext);
10    if (context === undefined) {
11      throw new Error('useAppContext must be used within an AppProvider');
12    }
13    return context;
14  }