code: function (caml) {
  
  			var folderQueue = [list.get_rootFolder()];
  			var allitems = [];
  
  			return $.Deferred(function (alldfd) {
  				ns.modules.funcs.processAsQueue(folderQueue, function (folder) {
  
  					return $.Deferred(function (dfd) {
  
  						ctx.load(folder, ["ServerRelativeUrl"]);
  						loadSpElem(folder.get_folders()).done(function (folders) {
  							spapi.collectionToArray(folders).forEach(function (n) {
  								folderQueue.push(n);
  							});
  
  							var folderUrl = folder.get_serverRelativeUrl();
  							caml = caml || "<View><RowLimit>1000</RowLimit></View>";
  
  							getAllItemsPaged(caml, folderUrl).done(function (items) {
  
  								for (var i = 0; i < items.length; i++) {
  
  									var li = items[i];
  									var vls = li.get_fieldValues();
  
  									if (vls.FSObjType == "1") //folder
  									{
  										folderQueue.push(li);
  									} else {
  										allitems.push(li);
  									}
  								}
  
  								dfd.resolve();
  							});
  
  						});
  					}).promise();
  				}).done(function () {
  					alldfd.resolve(allitems);
  				});
  
  			}).promise();
  		}
docs: For large lists, get items on individual folders, ** very slow **
  @param {SP.ListItem} tFolder