Proposal: Switch position of delay and callback in signature of `setTimeout()`
isiahmeadows at gmail.com
Mon Apr 25 21:48:23 UTC 2016
If it makes it into the language, I'd rather see `Function.delay(timeout,
callback)` or, even better, `Promise.delay(timeout).then(callback)`. The
latter would also fit better with modern ES standard language APIs, IMHO.
The latter has already been suggested here before, plenty of times, but
AFAICT, it's relatively low priority.
Beyond that, I agree that changing `setTimeout` is out of scope here.
On Mon, Apr 25, 2016, 14:04 Adrian Sieber <mail at adriansieber.com> wrote:
> @Boris Well, I wasn't aware the `setTimeout()` has such an absolutely
> broken API. So I guess a clean reset would be better/easier.
> How about making `setTimeout()` a part of ECMAscript. Maybe as
> `Date.setTimeout()` like it was done with `Number.parseInt()` … and this
> time with a saner API =D
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss