qalllib
v1.2.1
Published
q all sync and async
Downloads
54
Readme
Description 3 functions to reduce the qall complexity .
qalllib.qSyncAll(functionName, arrayOfElements) qalllib.qAsyncAll(functionName, arrayOfElements) qalllib.qASyncWithBatch(functionName, arrayOfElements, batchSize)
Params: arrayOfElements: is array for which the qall has to be executed . batchSize : interger default 10 batch size is to limit the async call to batch. helps to reduce overloading.
example
pass array to add function with batch size 3
qalllib.qASyncWithBatch(add, [1,2,3,4,5], 3) .then(function (data) { console.log((new Date()).toTimeString().slice(0, 8), 'end executing:') console.log(data) }) .catch(function (error) { console.log('error in catch',error) }) .done(console.log('promise done'))