enq.js
function binder(taskID) {
		expected++;
		return function(ret) {
			expected--;
			if(!returned && taskID !== 'false') {
				if		(typeof taskID == 'number') returned=[];
				else if (typeof taskID == 'string') returned={};
			};
			taskID !== false ? returned[taskID]=ret : returned = ret;
			// Timeout needed to increment expected, if next item exists.
			// If it run without timeout, expected always be 0 and only
			// the first function of the group will be executed.
			setTimeout(function(){if (! expected) runQueue();},1);
		}
	}
function binder(taskID) {
		expected++;
		return function(ret) {
			expected--;
			if(!returned && taskID !== 'false') {
				if		(typeof taskID == 'number') returned=[];
				else if (typeof taskID == 'string') returned={};
			};
			taskID !== false ? returned[taskID]=ret : returned = ret;
			// Timeout needed to increment expected, if next item exists.
			// If it run without timeout, expected always be 0 and only
			// the first function of the group will be executed.
			setTimeout(function(){if (! expected) runQueue();},1);
		}
	}
function binder ( taskID ) { expected ++ ; return function ( ret ) { expected -- ; if ( ! returned && taskID !== 'false' ) { if ( typeof taskID == 'number' ) returned = [ ] ; else if ( typeof taskID == 'string' ) returned = { } ; } ; taskID !== false ? returned [ taskID ] = ret : returned = ret ; // Timeout needed to increment expected, if next item exists. // If it run without timeout, expected always be 0 and only // the first function of the group will be executed. setTimeout ( function ( ) { if ( ! expected ) runQueue ( ) ; } , 1 ) ; } }
Generate the return function for taskObject. Each task needs a specific function to bind the response to correct order of call
Generate the return function for taskObject . Each task needs a specific function to bind the response to correct order of call