inicios del FrontEnd

This commit is contained in:
2021-04-21 21:47:04 -05:00
parent 4a7fb24eb2
commit cf9505f26d
196 changed files with 28978 additions and 0 deletions

15
APP/util/throttle.js Normal file
View File

@@ -0,0 +1,15 @@
/**
* Simple throttle function that executes a passed function only once in the specified timeout
* @param handlerFunc
* @param [timeout] the throttle interval
*/
export function throttle(handlerFunc, timeout = 66) {
let resizeTimeout;
if (!resizeTimeout) {
resizeTimeout = setTimeout(() => {
resizeTimeout = null;
handlerFunc();
// The actualResizeHandler will execute at a rate of 15fps
}, timeout);
}
}