Docs
API
Interfaces
MeshPubSub

Interface: MeshPubSub

types/src.MeshPubSub

Implemented by

Table of contents

Methods

Methods

asyncIterator

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

Type parameters

NameType
THookextends string

Parameters

NameType
triggersTHook

Returns

AsyncIterable<AllHooks[THook]>


publish

publish<THook>(triggerName, payload): void

Type parameters

NameType
THookextends string

Parameters

NameType
triggerNameTHook
payloadAllHooks[THook]

Returns

void


subscribe

subscribe<THook>(triggerName, onMessage, options?): number

Type parameters

NameType
THookextends string

Parameters

NameType
triggerNameTHook
onMessage(data: AllHooks[THook]) => void
options?any

Returns

number


unsubscribe

unsubscribe(subId): void

Parameters

NameType
subIdnumber

Returns

void