Closed dwalintukan closed 5 years ago
Considering the following code:
const myFunc = (var1) => {...} const promises = [] promises.push(limit(async (var1) => { myFunc(var1); }, passedVar1) await Promises.all(promises)
Should I be passing myFunc as part of the args when passing it to the limit generator? Or is the outside reference ok?
myFunc
Any function passed to limit() is limited, so if that function calls another one, it will naturally be limited too as it's called by the limited function. So in short, yes.
limit()
Considering the following code:
Should I be passing
myFunc
as part of the args when passing it to the limit generator? Or is the outside reference ok?