Put in some async

This commit is contained in:
Thomas FORGIONE 2015-06-10 12:00:57 +02:00
parent 821ca9ef10
commit 44939959f6
1 changed files with 49 additions and 44 deletions

View File

@ -26,6 +26,9 @@ var ProgressiveLoader = function(res, scene) {
// When receiving elements
socket.on('elements', function(arr) {
// Launch this code in async
setTimeout(function() {
// We'll receive an array of string (obj)
for (var i = 0; i < arr.length; i++) {
@ -93,6 +96,8 @@ var ProgressiveLoader = function(res, scene) {
} else {
console.log("Finished");
}
},0);
});
socket.on('finished', function(arg) {