resize-observer-polyfill.js 365 B

123456789101112131415
  1. export default class ResizeObserver {
  2. constructor(callback) {
  3. this._callback = callback;
  4. this._callbackCtx_ = this;
  5. window.addEventListener('resize', this._callback.bind(this._callbackCtx));
  6. }
  7. observe() {
  8. this._callback && this._callback.call(this._callbackCtx);
  9. }
  10. unobserve() {
  11. }
  12. disconnect() {
  13. }
  14. }