Skip to content

createSymbol

Construct a symbol instance and register it with devtools. Prefer this over calling new directly so that debugging tools can track the symbol.

import { createSymbol } from "@alloy-js/core";
function createSymbol<TSymbol extends OutputSymbol, Args extends unknown[]>(ctor: new (...args: Args) => TSymbol, ...args: Args): TSymbol;
ctornew (…args: Args) => TSymbol
argsArgs

TSymbol

Binder registration (via useBinder() + notifySymbolCreated()) happens inside the OutputSymbol constructor regardless of whether you use createSymbol or new. This helper only adds devtools registration.