@juggle/resize-observer
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -25,5 +25,7 @@ import { resizeObservers } from '../ResizeObserverController'; | ||
}); | ||
callbacks.forEach(function fireCallback(callback) { return callback(); }); | ||
for (let callback of callbacks) { | ||
callback(); | ||
} | ||
return shallowestDepth; | ||
}; | ||
export { broadcastActiveObservations }; |
@@ -31,10 +31,18 @@ import { process } from '../ResizeObserverController'; | ||
scheduled = false; | ||
const callbacks = []; | ||
rafSlot.forEach(callback => callbacks.push(callback)); | ||
resizeObserverSlot.forEach(callback => callbacks.push(callback)); | ||
const frameCallbacks = []; | ||
const resizeObserverCallbacks = []; | ||
rafSlot.forEach(callback => frameCallbacks.push(callback)); | ||
resizeObserverSlot.forEach(callback => resizeObserverCallbacks.push(callback)); | ||
rafSlot.clear(); | ||
resizeObserverSlot.clear(); | ||
for (let callback of callbacks) { | ||
callback(t); | ||
try { | ||
for (let callback of frameCallbacks) { | ||
callback(t); | ||
} | ||
} | ||
finally { | ||
for (let callback of resizeObserverCallbacks) { | ||
callback(t); | ||
} | ||
} | ||
} | ||
@@ -52,7 +60,16 @@ ; | ||
resizeObserverSlot.set(this, function ResizeObserver() { | ||
if (process()) { | ||
scheduler.run(60); | ||
let elementsHaveResized = false; | ||
try { | ||
elementsHaveResized = process(); | ||
} | ||
else if (frames) { | ||
scheduler.run(frames - 1); | ||
finally { | ||
if (elementsHaveResized) { | ||
scheduler.run(60); | ||
} | ||
else if (frames) { | ||
scheduler.run(frames - 1); | ||
} | ||
else { | ||
scheduler.start(); | ||
} | ||
} | ||
@@ -63,2 +80,6 @@ }); | ||
schedule() { | ||
if (scheduled) { | ||
return; | ||
} | ||
this.stop(); | ||
this.run(1); | ||
@@ -65,0 +86,0 @@ } |
{ | ||
"name": "@juggle/resize-observer", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Polyfills the ResizeObserver API and supports box size options from the latest spec", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ResizeObserver.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44691
632
1