Skip to content

Instantly share code, notes, and snippets.

@doug1n
Last active November 26, 2019 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doug1n/f5fa4c1b3c9fb890192d03428513c9fd to your computer and use it in GitHub Desktop.
Save doug1n/f5fa4c1b3c9fb890192d03428513c9fd to your computer and use it in GitHub Desktop.
Show loading and execute any function.
/*
* @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