UNPKG

preact

Version:

Fast 4kb React-compatible Virtual DOM library.

3 lines (2 loc) • 960 B
import{options as t}from"preact";function r(){return t.t=t.debounceRendering,t.debounceRendering=function(r){return t.o=r},function(){return t.o&&t.o()}}var n=function(t){return null!=t&&"function"==typeof t.then},o=0;function u(u){if(++o>1){try{var c=u();if(n(c))return c.then(function(){--o},function(t){throw--o,t})}catch(t){throw--o,t}return--o,Promise.resolve()}var e,f=t.requestAnimationFrame,a=r(),h=[];t.requestAnimationFrame=function(t){return h.push(t)};var y,l,v=function(){try{for(a();h.length;)e=h,h=[],e.forEach(function(t){return t()}),a()}catch(t){y||(y=t)}try{i()}catch(t){y||(y=t)}t.requestAnimationFrame=f,--o};try{l=u()}catch(t){y=t}if(n(l))return l.then(v,function(t){throw v(),t});if(v(),y)throw y;return Promise.resolve()}function i(){try{t.o&&t.o()}finally{delete t.o,void 0!==t.t?(t.debounceRendering=t.t,delete t.t):t.debounceRendering=void 0}}export{u as act,r as setupRerender,i as teardown}; //# sourceMappingURL=testUtils.mjs.map