Files

19 lines
626 B
TypeScript
Raw Permalink Normal View History

/**
* Custom hook for managing school comparison state.
*
* This hook is mounted on every page via the global Navigation and
* ComparisonToast, so it must stay cheap — it exposes basket state only.
* The compare page fetches `/api/compare` itself (ComparisonView); nothing
* ever read the comparison payload from here, so the previous per-page SWR
* fetch (which fired on every page whenever the basket was non-empty) was
* dead weight and has been removed.
*/
'use client';
import { useComparisonContext } from '@/context/ComparisonContext';
export function useComparison() {
return useComparisonContext();
}