mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
Refactor AppProvider, AppConfig and presetRelays
This commit is contained in:
8 files changed
+46
-26
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { useContext } from "react";
|
||||
import { AppContext, type AppContextType } from "@/contexts/AppContext";
|
||||
|
||||
/**
|
||||
* Hook to access and update application configuration
|
||||
* @returns Application context with config and update methods
|
||||
*/
|
||||
export function useAppContext(): AppContextType {
|
||||
const context = useContext(AppContext);
|
||||
if (context === undefined) {
|
||||
throw new Error('useAppContext must be used within an AppProvider');
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in new issue
Block a user