Last active
November 26, 2019 19:56
-
-
Save doug1n/f5fa4c1b3c9fb890192d03428513c9fd to your computer and use it in GitHub Desktop.
Show loading and execute any function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @function mostraLoading Show loading and execute any function. | |
* @param {Object} loading referência a variavel de loading que será utilizada | |
* @param {Function} anyFunction function to execute while loading shows. | |
*/ | |
function mostraLoading(loading, anyFunction, ...anyParam) { | |
loading.show(); | |
setTimeout(function () { | |
anyFunction(...anyParam); | |
loading.hide(); | |
}, 300); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment