BSyncBox

1. Get the BSyncBox.js file:

BSyncBox.js (Right click and "Save link as...")

2. Include the file in your project:

<script type="text/javascript" src="BSyncBox.js"></script>

3. Look at the Example Code ↓

/* use case */

var results = [];

var syb = new BSyncBox({
		fn : mapID,
		ctx : results
	}).start(1000);

	
syb.addArray(loadGen(600,600)).stopAfter(function () {
	console.log('Done', 'this === syb:', this === syb, ', results length:', results.length);
});


function mapID() {
	
	var i = 0;

	var length = arguments.length;
	
	while (i < length) {
	
		this.push(arguments[i].id);
		
		i += 1;
		
	}
	
}

function loadGen (maxX, maxY){
	var r = [];
	var o;
	var x;
	var y;
	
	maxX = maxX || 1;
	maxY = maxY || 1;
	
	for (x = 0 ; x < maxX; x++) {
		r.push([]);
		for (y = 0 ; y < maxY; y++) {
		
			r[r.length-1].push({x: x, y: y});
			
		}
		
	}
	return r;
}


Warning: file_put_contents(BSyncBox.html) [function.file-put-contents]: failed to open stream: Permission denied in /home/csgo/domains/jsmaker.com/public_html/BSyncBox/index.php on line 78