Skip to content

Commit

Permalink
UTDTEK-3266 Bygd endringene for npm-pakke
Browse files Browse the repository at this point in the history
  • Loading branch information
uhbe committed Jun 13, 2024
1 parent efb3d6a commit e63024f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions es/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function useTooltip(_ref) {
hide
};
}

//let observer = new IntersectionObserver(handleResize);
//observer.observe(viz);

const useResize = (viz, width, setWidth) => {
(0, _react.useEffect)(() => {
const handleResize = () => {
Expand All @@ -50,6 +54,9 @@ const useResize = (viz, width, setWidth) => {
};
handleResize();
window.addEventListener("resize", handleResize);
let observer = new IntersectionObserver(handleResize);
console.log(viz);
observer.observe(viz.current);
return () => {
window.removeEventListener("resize", handleResize);
};
Expand Down
7 changes: 7 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function useTooltip(_ref) {
hide
};
}

//let observer = new IntersectionObserver(handleResize);
//observer.observe(viz);

const useResize = (viz, width, setWidth) => {
(0, _react.useEffect)(() => {
const handleResize = () => {
Expand All @@ -50,6 +54,9 @@ const useResize = (viz, width, setWidth) => {
};
handleResize();
window.addEventListener("resize", handleResize);
let observer = new IntersectionObserver(handleResize);
console.log(viz);
observer.observe(viz.current);
return () => {
window.removeEventListener("resize", handleResize);
};
Expand Down

0 comments on commit e63024f

Please sign in to comment.