I had not realised how awesome yield-style generators (Python, C#) are in combinations with promises. https://www.promisejs.org/generators/
@tirsen here's an attempt to translate the async login example from your original link to an async Scala method: https://gist.github.com/avibryant/0008b001537fb975292b …
-
-
@avibryant interesting. Can you only "wait" for a future on top of the for? What if you need to add new futures in a loop or conditionally? -
@tirsen yeah, in those cases you'd probably have to end up breaking it into a recursive function or similar.
End of conversation
New conversation -
-
-
@tirsen because "for" sounds like a loop construct it's not at all obvious how flexible the syntax is until you start using it.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.