generative-a11y
DOM

bindRuntime

Subscribe an existing core runtime to a Announcer while preserving separate runtime and browser ownership.

Signature and import

bindRuntime borrows your runtime. Disposing its binding removes only subscription and announcer resources.

import { createRuntime } from "@generative-a11y/core";
import { bindRuntime } from "@generative-a11y/dom";

const runtime = createRuntime();
const delivery = bindRuntime(runtime, { mode: "auto" });

runtime.dispatch(event);

// Call when the chat surface is removed.
export function disposeChat() {
  delivery.dispose();
  runtime.dispose();
}

Walkthrough

Create the runtime

Your app creates and owns the core runtime.

Connect browser delivery

Connect the DOM binding before your app sends events.

Clean up in order

Dispose the DOM binding before you dispose the runtime.

Prop

Type

RuntimeBinding

dispose leaves app-supplied runtimes and live regions intact.

Prop

Type