• Use this function to create a resource in an async context. This will make sure the resources are cleaned up before returning.

    Example:

    await using(res = new SomeResource(), async (res) =>  {
    res.do_the_thing();
    });

    Type Parameters

    Parameters

    • resource: T
    • func: ((resource) => void)
        • (resource): void
        • Parameters

          • resource: T

          Returns void

    Returns Promise<void>

Generated using TypeDoc