Skip to main content

types_src.meshpubsub

Interface: MeshPubSub#

types/src.MeshPubSub

Table of contents#

Methods#

Methods#

asyncIterator#

asyncIterator<THook\>(triggers: THook): AsyncIterator<AllHooks[THook], any, undefined\>

Type parameters:#

NameType
THookstring

Parameters:#

NameType
triggersTHook

Returns: AsyncIterator<AllHooks[THook], any, undefined\>

Defined in: packages/types/src/index.ts:68


publish#

publish<THook\>(triggerName: THook, payload: AllHooks[THook]): Promise<void\>

Type parameters:#

NameType
THookstring

Parameters:#

NameType
triggerNameTHook
payloadAllHooks[THook]

Returns: Promise<void\>

Defined in: packages/types/src/index.ts:61


subscribe#

subscribe<THook\>(triggerName: THook, onMessage: (data: AllHooks[THook]) => void, options?: any): Promise<number\>

Type parameters:#

NameType
THookstring

Parameters:#

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

Returns: Promise<number\>

Defined in: packages/types/src/index.ts:62


unsubscribe#

unsubscribe(subId: number): void

Parameters:#

NameType
subIdnumber

Returns: void

Defined in: packages/types/src/index.ts:67