applyEach arguments position
See original GitHub issueCurrently 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?)
Issue Analytics
- State:
- Created 7 years ago
- Comments:18
Top Results From Across the Web
Use contents of a list as positional arguments to a single ...
It is possible to represent N-ary functions like so: data FunN r a = FunN Int (a -> FunN r a) | FNil...
Read more >Accepting any number of arguments to a function
To make a function that accepts any number of arguments, you can use the * operator and then some variable name when defining...
Read more >On Philosophical Argumentation
Johnstone is correct, who, analyzing the ideas of "cogency" and "formai validity," emphasizes that "cogent philosophical arguments are formally valid, and no ...
Read more >Function.prototype.apply() - JavaScript - MDN Web Docs
The apply() method calls the specified function with a given this value, and arguments provided as an array (or an array-like object).
Read more >Python: module Gui
keyword arguments are passed as options to the widget constructor. ... pos(bbox, offset): return the position at the given offset from bbox upper-left....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve proposed allowing the usage of spread elements within tuples to solve this case syntactically
BTW, I’m 👍 for having the
args
be an array in the case ofapplyEach
. Having an optional param after a rest param will always lead to ambiguities.