Padloc Logo Docs & Resources

Class: StubMessenger

messenger.StubMessenger

Stub implementation of the Messenger interface. Simply stores messages in memory. Useful for testing purposes.

Implements

Constructors

constructor

new StubMessenger()

Properties

messages

messages: { message: Message<any> ; recipient: string }[] = []

An array of messages passed to the send method. Sorted from most recent to oldest.

Defined in

core/src/messenger.ts:90

Methods

lastMessage

lastMessage(addr): null | Message<any>

Returns the most recent message sent to addr.

Parameters

Name Type
addr string

Returns

null | Message<any>

Defined in

core/src/messenger.ts:99


send

send<T>(recipient, message): Promise<void>

Sends a message to a given address

Type parameters

Name Type
T extends MessageData

Parameters

Name Type
recipient string
message Message<T>

Returns

Promise<void>

Implementation of

Messenger.send

Defined in

core/src/messenger.ts:92