Skip to content

Commit

Permalink
docs: link and clarify re: using
Browse files Browse the repository at this point in the history
  • Loading branch information
hugojosefson committed Sep 17, 2023
1 parent 6b70339 commit 7f0559e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/using.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* Similar to TC39 proposal for `using` blocks.
* Similar to the TC39 proposal for `using` blocks, named [Explicit Resource
* Management](https://github.com/tc39/proposal-explicit-resource-management).
*
* Give it a bunch of functions that each create a resource, and a function that uses those resources.
* It will call the resource-creating functions, and pass the resources to the using function.
* Then "finally" it will [Symbol.dispose]?.(), await [Symbol.asyncDispose]?.(), and await close?.() all the resources.
* Give this a bunch of functions that each create a resource
* (`resourceFactories`), and a function that uses those resources (`fn`). It
* will call the `resourceFactories`, then pass their resources to `fn`. Then
* "finally" it will `[Symbol.dispose]?.()`, `await [Symbol.asyncDispose]?.()`,
* and `await close?.()` all the resources.
*/
export async function using<
T,
Expand Down

0 comments on commit 7f0559e

Please sign in to comment.