@ts-core/angular 13.0.14 → 13.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1826,19 +1826,10 @@ class ResizeManager {
1826
1826
  // Event Handlers
1827
1827
  //
1828
1828
  // --------------------------------------------------------------------------
1829
- this.resizeHandler = () => this.subject.next(this.getSize());
1830
- this.compare = (previous, current) => previous.width === current.width && previous.height === current.height;
1829
+ this.handler = (item) => this.subject.next(item);
1831
1830
  this.element = ViewUtil.parseElement(element);
1832
- this.subject = new BehaviorSubject(this.getSize());
1833
- this.sensor = new ResizeSensor(this.element, this.resizeHandler);
1834
- }
1835
- // --------------------------------------------------------------------------
1836
- //
1837
- // Private Methods
1838
- //
1839
- // --------------------------------------------------------------------------
1840
- getSize() {
1841
- return { width: ViewUtil.getWidth(this.element), height: ViewUtil.getHeight(this.element) };
1831
+ this.subject = new BehaviorSubject({ width: ViewUtil.getWidth(this.element), height: ViewUtil.getHeight(this.element) });
1832
+ this.sensor = new ResizeSensor(this.element, this.handler);
1842
1833
  }
1843
1834
  // --------------------------------------------------------------------------
1844
1835
  //
@@ -1846,7 +1837,10 @@ class ResizeManager {
1846
1837
  //
1847
1838
  // --------------------------------------------------------------------------
1848
1839
  get changed() {
1849
- return this.subject.asObservable().pipe(distinctUntilChanged(this.compare));
1840
+ return this.subject.asObservable().pipe(distinctUntilChanged(_.isEqual));
1841
+ }
1842
+ get value() {
1843
+ return this.subject.getValue();
1850
1844
  }
1851
1845
  // --------------------------------------------------------------------------
1852
1846
  //
@@ -1854,15 +1848,15 @@ class ResizeManager {
1854
1848
  //
1855
1849
  // --------------------------------------------------------------------------
1856
1850
  destroy() {
1857
- if (!_.isNil(this.subject)) {
1858
- this.subject.complete();
1859
- this.subject = null;
1860
- }
1861
1851
  if (!_.isNil(this.sensor)) {
1862
- this.sensor.detach(this.resizeHandler);
1852
+ this.sensor.detach(this.handler);
1863
1853
  this.sensor.reset();
1864
1854
  this.sensor = null;
1865
1855
  }
1856
+ if (!_.isNil(this.subject)) {
1857
+ this.subject.complete();
1858
+ this.subject = null;
1859
+ }
1866
1860
  this.element = null;
1867
1861
  }
1868
1862
  }