MCPcopy Create free account
hub / github.com/ampproject/amphtml / proxy

Function proxy

third_party/resize-observer-polyfill/ResizeObserver.js:781–800  ·  view source on GitHub ↗

* Schedules invocation of the original function. * * @returns {void}

()

Source from the content-addressed store, hash-verified

779 * @returns {void}
780 */
781 function proxy() {
782 var timeStamp = Date.now();
783 if (leadingCall) {
784 // Reject immediately following calls.
785 if (timeStamp - lastCallTime < trailingTimeout) {
786 return;
787 }
788 // Schedule new call to be in invoked when the pending one is resolved.
789 // This is important for "transitions" which never actually start
790 // immediately so there is a chance that we might miss one if change
791 // happens amids the pending invocation.
792 trailingCall = true;
793 }
794 else {
795 leadingCall = true;
796 trailingCall = false;
797 setTimeout(timeoutCallback, delay);
798 }
799 lastCallTime = timeStamp;
800 }
801 return proxy;
802 }
803

Callers 1

resolvePendingFunction · 0.70

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected