Last active
August 23, 2018 03:01
-
-
Save mauriciodarocha/b29bc4f06d97318fa71760d3c33532f4 to your computer and use it in GitHub Desktop.
delay loading of app
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
/** 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