pos-dashboard-v2/src/hooks/useIntersection.ts
2025-08-05 12:35:40 +07:00

17 lines
367 B
TypeScript

// React Imports
import { useContext } from 'react'
// Context Imports
import { IntersectionContext } from '@/contexts/intersectionContext'
export const useIntersection = () => {
// Hooks
const context = useContext(IntersectionContext)
if (!context) {
throw new Error('useIntersection must be used within a IntersectionProvider')
}
return context
}