Skip to main content
Module

x/disposable/mod.ts>usingAll

🦕 Ensure a disposable resource is disposed in Deno
Go to Latest
function usingAll
import { usingAll } from "https://deno.land/x/disposable@v1.0.2/mod.ts";

Ensure synchronous and/or asynchronous disposable resources are disposed

It invokes 'dispose()' method of resources prior to leave the inner function. It suppors both synchronous and asynchronous disposables.

Type Parameters

T extends readonly Disposable[]
optional
R = unknown

Parameters

resources: [...T]
fn: (...resources: [...T]) => R | Promise<R>

Returns

Promise<R>