Currently the applyEach and applyEachSeries functions have the following type signature:
async.applyEach(fns, ...args?, callback?)
Having a rest parameter in the middle of the arguments list is very difficult to write a type annotation for. It's currently not possible in either Flow or TypeScript, which is why you see stuff like this (I'm writing a similar type definition for Flow right now).
Would it be okay to switch the argument order around and make callback nullable so it is like this?
async.applyEach(fns, callback | null, ...args?)
Or use an array instead of a rest parameter?
async.applyEach(fns, args?: Array<any>, callback?)
Currently the
applyEachandapplyEachSeriesfunctions have the following type signature:Having a rest parameter in the middle of the arguments list is very difficult to write a type annotation for. It's currently not possible in either Flow or TypeScript, which is why you see stuff like this (I'm writing a similar type definition for Flow right now).
Would it be okay to switch the argument order around and make callback nullable so it is like this?
Or use an array instead of a rest parameter?