Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on TypeScript 5.2's New Keyword: 'using'. Parent comment
Now you can just call “await using foo(…)”, rather than the try/finally pattern, and get the automatic dispose call on leaving scope.
Kotlin has “use” with a similar effect, and i much prefer it over try/finally. Might be worth checking it out too.
There are no comments on this comment yet.
Now you can just call “await using foo(…)”, rather than the try/finally pattern, and get the automatic dispose call on leaving scope.
Kotlin has “use” with a similar effect, and i much prefer it over try/finally. Might be worth checking it out too.