Docs
API
Classes
PubSub

Class: PubSub

utils/src.PubSub

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new PubSub()

Methods

asyncIterator

asyncIterator<THook>(triggerName): AsyncIterable<AllHooks[THook]>

Type parameters

NameType
THookextends string

Parameters

NameType
triggerNameTHook

Returns

AsyncIterable<AllHooks[THook]>

Implementation of

MeshPubSub.asyncIterator


publish

publish<THook>(triggerName, detail): void

Type parameters

NameType
THookextends string

Parameters

NameType
triggerNameTHook
detailAllHooks[THook]

Returns

void

Implementation of

MeshPubSub.publish


subscribe

subscribe<THook>(triggerName, onMessage): number

Type parameters

NameType
THookextends string

Parameters

NameType
triggerNameTHook
onMessageListener<THook>

Returns

number

Implementation of

MeshPubSub.subscribe


unsubscribe

unsubscribe(subId): void

Parameters

NameType
subIdnumber

Returns

void

Implementation of

MeshPubSub.unsubscribe