import { useMemo } from 'react'; import { useQuery } from '@tanstack/react-query'; import { apiFetch } from '../lib/api'; export function useFollowing(): Set { const { data, error } = useQuery({ queryKey: ['me-following'], queryFn: async () => { const r = await apiFetch<{ userIds: string[] }>('/api/me/following'); return r; }, staleTime: 5 * 60_000, }); if (error) console.warn('[presence] /api/me/following ERROR:', error); return useMemo(() => new Set(data?.userIds ?? []), [data]); }