UNPKG

@tarojs/components

Version:
1 lines 559 B
function t(t,e=250,n){let o,i=0;return function(...u){const c=n||this,s=Date.now();s-i>e?(t.apply(this,u),i=s):(clearTimeout(o),o=setTimeout((()=>{i=s,t.apply(c,u)}),e))}}function e(t,e=250,n){let o;return function(...i){const u=n||this;clearTimeout(o),o=setTimeout((function(){t.apply(u,i)}),e)}}function n(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function o(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}export{n as a,e as d,o as i,t}