Defer expression

Karl Thunberg dundercover at
Wed Aug 16 19:55:03 UTC 2017

Hi, is there any proposal for an expression to invoke something after the
current call stack has cleared? Lodash `defer` is a good example.

Just like I can use `await` to pause the execution of the current call, it
would be nice to also have an expression to queue up something that cannot
run immediately e.g. `defer doThisLater();`

The current solution is to use `setTimeout` with a 1 ms delay but that is
not a good solution as it is not the same thing and it makes it more
difficult for people to understand what is the true purpose of that line of
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list