import { useRecoilValue } from 'recoil';
import { breakpointIsLoaded } from "../../../atoms/breakpoint/index.js";

/**
 * Determine if the breakpoint has loaded and taken a measurement. This can be
 * a useful indicator of when the app has loaded and shifted its layout
 * appropriately for the user's display.
 */
const useBreakpointIsLoaded = function useBreakpointIsLoaded(key = 'window') {
  return useRecoilValue(breakpointIsLoaded(key));
};
export default useBreakpointIsLoaded;