Message from JavaScript discussions

December 2018

— ?

— 

1. spawn runs, queues coroutine ahead of current one
2. new coroutine runs, returns value
3. first coroutine sets thenable to get the value

— .then(
value => doSomething,
error => doSomething)

— So the return value is returned before there is a then set

— In the case of a direct return like that one, I mean

— Uhhh, I don't get it

— Show breaking usage

— It's just an architecture thing to address

— I'd have to save the return value past the next cycle

— Yes, promises do this too

— Because when return happens and a stack is emptied, the return value is lost

— Like what happens if the caller sets the then like 5 mins after the returning coroutine returns