package.react-utils.useBreakpoints.index.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
import { useSyncExternalStore } from "react";
import { equals } from "ramda";
import { getCurrentSize, subscribe } from "./utils";
var useBreakpoints = function useBreakpoints(breakpointOverrides) {
var getSnapshot = function getSnapshot() {
return getCurrentSize(window, breakpointOverrides);
};
var currentSize = useSyncExternalStore(subscribe, getSnapshot);
return {
currentSize: currentSize,
isSize: equals(currentSize)
};
};
export default useBreakpoints;
//# sourceMappingURL=index.js.map