/**
* Extend all objects with the process property
*
* @author Gert-Jan Jansma <gj.jansma@gmail.com>
* @param Object Container for process names
*/
Object.prototype.process = {};
/**
* Extend all objects with the afterProcess Method
*
* @author Gert-Jan Jansma <gj.jansma@gmail.com>
* @param string processName Name of the process
* @param function fn Function to be executed after a process
* @param int interval Delay time in microseconds
*/
Object.prototype.afterProcess = function(processName, fn, interval){
var afterProcess = setInterval(
(function(){
if(process[processName] === false){
fn();
clearInterval(afterProcess);
}
}), ((interval) ? interval : 100)
);
};
/**
* Extend all objects with the process property
*
* @author Gert-Jan Jansma <gj.jansma@gmail.com>
* @param Object Container for process names
*/
Object.prototype.process = {};
/**
* Extend all objects with the afterProcess Method
*
* @author Gert-Jan Jansma <gj.jansma@gmail.com>
* @param string processName Name of the process
* @param function fn Function to be executed after a process
* @param int interval Delay time in microseconds
*/
Object.prototype.afterProcess = function(processName, fn, interval){
var afterProcess = setInterval(
(function(){
if(process[processName] === false){
fn();
clearInterval(afterProcess);
}
}), ((interval) ? interval : 100)
);
};