comms library

Classes

ListenerDelegate<T>
Helper class used in MultiListener to create Listeners of specified types.
MessageSinkRegister
Allows communication between Listeners and Senders of the same type, without the need of them knowing about each other.

Mixins

Listener<Message>
A mixin used on classes that want to receive messages of type Message.
MultiListener
A mixin used on classes that want to receive messages of multiple types.
Sender<Message>
A mixin used on classes that want to send messages of type Message, by providing send function.

Functions

getSend<Message>() Send<Message>
Returns function to send messages to all Listeners of type Message, without the need of instatiating class with Sender mixin.

Typedefs

LoggerCallback = void Function(String message)
OnMessage<Message> = void Function(Message message)
Signature for callbacks that are run when a message is received.
Send<Message> = void Function(Message message, {bool oneOff})
Signature for functions sending message to Listeners listening for type Message.