Skip to content
TypeScript
307 B
Raw Blame
// Browsers may not support `using`, so the client build should lower it
const disposed: string[] = [];
{
  using _resource = {
    [Symbol.dispose]() {
      disposed.push("resource");
    },
  };
}
const heading = document.querySelector("h1");
if (heading) {
  heading.textContent = disposed.join(",");
}