import { modifier } from 'ember-modifier';
import { isWithinBreakpoints } from '../utils/breakpoint.js';

var useIsWithinBreakpoints = modifier(function (_element, _pos, {
  sizes,
  isActive = true,
  setIsWithinBreakpointsValue
}) {
  function handleResize() {
    setIsWithinBreakpointsValue(isWithinBreakpoints(window.innerWidth, sizes));
  }
  if (isActive) {
    window.removeEventListener("resize", handleResize);
    window.addEventListener("resize", handleResize);
    handleResize();
  }
  return () => window.removeEventListener("resize", handleResize);
});

export { useIsWithinBreakpoints as default };
//# sourceMappingURL=use-is-within-breakpoints.js.map
