UNPKG

@tarojs/components

Version:
1 lines 401 B
function t(t,n=250,e){let i,o=0;return function(...u){const c=e||this,s=Date.now();s-o>n?(t.apply(this,u),o=s):(clearTimeout(i),i=setTimeout((()=>{o=s,t.apply(c,u)}),n))}}function n(t,n=250,e){let i;return function(...o){const u=e||this;clearTimeout(i),i=setTimeout((function(){t.apply(u,o)}),n)}}function e(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}export{n as d,e as i,t}