# Online ```typescript // Create the online hook using the factory const useContextOnline = createContextHook({ endpoint: "/context/page/online", contextName: "online", enablePeriodicRefresh: true, refreshInterval: 5 * 60 * 1000, // 5 minutes }); // Custom hook for online data with the expected interface interface UseOnlineResult { onlineData: ClientOnline | null; isLoading: boolean; error: string | null; refreshOnline: () => Promise; updateOnline: (newOnline: ClientOnline) => Promise; } // Wrapper hook that adapts the generic hook to the expected interface export function useOnline(): UseOnlineResult { const { data, isLoading, error, refresh, update } = useContextOnline(); return { onlineData: data, isLoading, error, refreshOnline: refresh, updateOnline: update, }; } ```