@thalesrc/resize-manager
v0.5.0
Published
Improved Resize Events of Window & Dom Elements
Downloads
321
Maintainers
Readme
@thalesrc/resize-manager
Rxjs Based Resize Events of Window & Dom Elements
Installation
npm install @thalesrc/resize-manager --save
All Documentation => thalesrc.github.io/resize-manager
Basic Usage
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);
});