Tag

async disposal

1 views collected around this technical thread.

JavaScript
JavaScript
Apr 7, 2025 · Backend Development

Simplify JavaScript Resource Management with the New ‘using’ Declaration

This article explains how the upcoming JavaScript ‘using’ declaration, inspired by C# and Python, can replace verbose try…finally patterns for both synchronous and asynchronous resources, offering cleaner syntax, automatic disposal, and practical examples across files, databases, and mutexes.

JavaScriptTC39async disposal
0 likes · 5 min read
Simplify JavaScript Resource Management with the New ‘using’ Declaration
Sohu Tech Products
Sohu Tech Products
Jun 20, 2024 · Fundamentals

Understanding the "using" Keyword in TypeScript for Resource Management

The new TypeScript `using` keyword lets developers declare disposable resources—objects implementing `Symbol.dispose` or `Symbol.asyncDispose`—so that they are automatically cleaned up (e.g., closing database connections) without manual try/finally code, improving safety and developer experience.

DatabaseSymbol.disposeTypeScript
0 likes · 4 min read
Understanding the "using" Keyword in TypeScript for Resource Management