Skip to content

API reference / @chanx-js/server / core / topicConsumer

Function: topicConsumer() ​

ts
function topicConsumer<Path>(
   target, 
   path, 
   options?
): ConsumerBuilder<Path, Record<never, never>, unknown, never>;

Defined in: packages/server/src/topic.ts:294

Serve a Topic class alone on a route, as topic().asConsumer() does for a builder.

Type Parameters ​

Type Parameter
Path extends string

Parameters ​

ParameterType
targetTopicLike
pathPath
options{ name?: string; }
options.name?string

Returns ​

ConsumerBuilder<Path, Record<never, never>, unknown, never>

MIT licensed