Rxjs Based Resize Events of Window & Dom Elements
npm install @thalesrc/resize-manager --save
All Documentation => thalesrc.github.io/resize-manager
import { ResizeObserver } from '@thalesrc/resize-manager';
const element = document.querySelector('foo');
const observer = new ResizeObserver(element);
observer.resize.subscribe(({width, height}) => {
console.log(width, height);
});
or
import { ResizeManager } from '@thalesrc/resize-manager';
const element1 = document.querySelector('foo');
const element2 = document.querySelector('bar');
const manager = new ResizeManager();
manager.observe(element1).resize.subscribe(({width, height}) => {
console.log(width, height);
});
manager.observe(element2).resize.subscribe(({width, height}) => {
console.log(width, height);
});