mirror of
https://github.com/moodle/moodle.git
synced 2025-07-26 17:00:37 +02:00
This commit breaks apart the responsibilities of the core/templates module to separate out the different constituent parts. Broadly speaking these are: - core/local/templates/loader - responsible for fetching, and caching, of templates - core/local/templates/renderer - A Moodle wrapper around the Mustache engine
3 lines
963 B
JavaScript
3 lines
963 B
JavaScript
define("core/utils",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.throttle=_exports.getNormalisedComponent=_exports.debounce=void 0;_exports.throttle=(func,wait)=>{let onCooldown=!1,runAgain=null;const run=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];runAgain=null!==runAgain,onCooldown||(func.apply(this,args),onCooldown=!0,setTimeout((()=>{const recurse=runAgain;onCooldown=!1,runAgain=null,recurse&&run(args)}),wait))};return run};_exports.debounce=(func,wait)=>{let timeout=null;return function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];clearTimeout(timeout),timeout=setTimeout((()=>{func.apply(this,args)}),wait)}};_exports.getNormalisedComponent=component=>component&&"moodle"!==component&&"core"!==component?component:"core"}));
|
|
|
|
//# sourceMappingURL=utils.min.js.map
|