Promise-returning delay function

Andrea Giammarchi andrea.giammarchi at
Tue Oct 28 15:38:12 PDT 2014

try to put a cancel in your same code:

function tryToAscend() {
return Door.close().then(function() { return raiseLift(); },
function(e) { return*1000).then(tryToAscend); });

because when the door opens somebody cancel the floor and wants to descend

Then implement the case when actually the call was simply canceled and
nobody has to go anywhere ... all while delay keeps saying to each floor
that after 10 seconds doors should close anyway.

Now try to pass this glorious flow around per each panel in each floor that
should behave accordingly.

Can you do this via Promises? 'cause I'm pretty sure that code won't look
any better than an event based one, but I can be wrong.


On Tue, Oct 28, 2014 at 10:30 PM, C. Scott Ananian <ecmascript at>

> Again, I don't see how this requires some new sort of control flow.
>  --scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list