Skip to content

Commit

Permalink
sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
snakemanuver committed Jan 19, 2025
1 parent f6fe144 commit b49323c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/hooks/useBreakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export function useBreakpoints() {
return size.width >= BREAKPOINTS[breakpoint];
}
function isBetween(start: Breakpoints, end: Breakpoints) {
if (BREAKPOINTS[start] > BREAKPOINTS[end]) {
throw new Error("Start breakpoint must be less than end breakpoint");
}
return size.width >= BREAKPOINTS[start] && size.width < BREAKPOINTS[end];
}

Expand Down

0 comments on commit b49323c

Please sign in to comment.