Creates a scope guard that will invoke it's lambda when the function terminates. The scopeGuard must be created and assigned to a variable marked with the using keyword.
using
using onExit = scopeGuard(() => console.log("Exiting scope")); Copy
using onExit = scopeGuard(() => console.log("Exiting scope"));
The lambda to invoke when the object is being disposed.
A Disposable object that can be used to dispose the object.
Creates a scope guard that will invoke it's lambda when the function terminates. The scopeGuard must be created and assigned to a variable marked with the
usingkeyword.