Proposal: Switch position of delay and callback in signature of `setTimeout()`

Isiah Meadows 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
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160425/00e8bbe2/attachment.html>


More information about the es-discuss mailing list