Isiah Meadows (2016-12-31T16:33:45.000Z)
Not enough. Not looking for an `await` replacement, but something
closer to Python's `with` statement or Java's `try`-with-resources.
Or, if you want something

Python: http://preshing.com/20110920/the-python-with-statement-by-example/
Java: https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

JavaScript's idioms tend towards Python, Java, C#, etc. in how
resources are handled, so things like Ruby's `begin`-`ensure` wouldn't
work as well (that was where I got my generator workaround from,
actually, and as you can see, it's not exactly very obvious).
-----

Isiah Meadows
me at isiahmeadows.com


On Fri, Dec 30, 2016 at 2:03 AM, J Decker <d3ck0r at gmail.com> wrote:
> Just a shot; but something ilke deasync ?
> https://www.npmjs.com/package/deasync
>
> it's not so much about ordering wait in the current code, but the current
> code within outer code that's the issue somehow?
forbes at lindesay.co.uk (2017-01-08T05:36:15.444Z)
Not enough. Not looking for an `await` replacement, but something
closer to Python's `with` statement or Java's `try`-with-resources.
Or, if you want something

Python: http://preshing.com/20110920/the-python-with-statement-by-example/  
Java: https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

JavaScript's idioms tend towards Python, Java, C#, etc. in how
resources are handled, so things like Ruby's `begin`-`ensure` wouldn't
work as well (that was where I got my generator workaround from,
actually, and as you can see, it's not exactly very obvious).