@vnmfify/core
Version:
```shell npm i @vnmfify/core -S ```
13 lines (10 loc) • 471 B
JavaScript
import { offWindowResize, onWindowResize } from "@vnxjs/vnmf";
import { useEffect } from "react";
function useWindowResize(callback) {
useEffect(() => {
onWindowResize === null || onWindowResize === void 0 ? void 0 : onWindowResize(callback);
return () => offWindowResize === null || offWindowResize === void 0 ? void 0 : offWindowResize(callback);
}, [callback]);
}
export default useWindowResize;
//# sourceMappingURL=use-window-resize.js.map