Skip to content

Instantly share code, notes, and snippets.

@mauriciodarocha
Last active August 23, 2018 03:01
Show Gist options
  • Save mauriciodarocha/b29bc4f06d97318fa71760d3c33532f4 to your computer and use it in GitHub Desktop.
Save mauriciodarocha/b29bc4f06d97318fa71760d3c33532f4 to your computer and use it in GitHub Desktop.
delay loading of app
/** 201808222232 */
var delayApps = (function ($, window, document, undefined) {
return function (apps,delay) {
var _apps = "function"===typeof apps ? [apps] : apps instanceof Array ? apps : undefined;
if("undefined"===typeof apps&&!(apps instanceof Array)) { return false; }
var _self = this;
var _delay = delay || 10000;
var __timeout = _self.setTimeout(function () {
"object"===typeof console&&"function"===typeof console.log&&console.log('Starting apps.');
$.each(_apps,function (ndx,_app) {
"function"===typeof _app&&_app();
});
_self.clearTimeout(__timeout);
}, _delay);
};
})(jQuery, window, document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment