Disposes a single object efficiently without creating arrays.
Use this method when disposing only one object to avoid the overhead of creating an arguments array.
The object to dispose.
If true, catches and logs exceptions instead of throwing them.
const resource = new MyResource();dispose.single(resource); // Throws on errordispose.single(resource, true); // Logs errors instead of throwing Copy
const resource = new MyResource();dispose.single(resource); // Throws on errordispose.single(resource, true); // Logs errors instead of throwing
Disposes a single object efficiently without creating arrays.
Use this method when disposing only one object to avoid the overhead of creating an arguments array.