Skip to content

Documentation / @super-line/server / RoleLens

Interface: RoleLens<C, R> ​

Defined in: index.ts:281

Lens for role-scoped server sends, returned by srv.forRole(role).

Type Parameters ​

C ​

C extends Contract

R ​

R extends RoleOf<C>

Methods ​

publish() ​

publish<T>(topic, data): void

Defined in: index.ts:283

Publish to a topic in role R's surface (reaches that role's subscribers).

Type Parameters ​

T ​

T extends string | number | symbol

Parameters ​

topic ​

T

data ​

EmitData<TopicsOf<StcOf<C["roles"][R]>>[T]>

Returns ​

void

Released under the MIT License.