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

Function proxy

third_party/resize-observer-polyfill/ResizeObserver.install.js:780–799  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers 1

resolvePendingFunction · 0.70

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected