Skip to content

getChannel

getChannel<TName>(name?): Channel<ResolveChannelMap<TName>>

Defined in: packages/postal/src/channel.ts:723

Gets or creates a singleton channel by name.

The first call with a given name creates the channel. Subsequent calls return the same instance. The TMap generic is compile-time only — all call sites referencing the same channel name should use the same TMap.

TName extends string = "__default__"

TName = ...

The channel name (defaults to "__default__")

Channel<ResolveChannelMap<TName>>

The singleton channel instance