Function: shouldReceiveMessage()
Makaio Framework / bus-core / shouldReceiveMessage
Function: shouldReceiveMessage()
Section titled “Function: shouldReceiveMessage()”shouldReceiveMessage(
subject,payload,subscriptions,filters):boolean
Defined in: ../../../packages/bus-core/src/utils/transport-helpers.ts:36
Check if a client/tab wants to receive a message based on subscriptions and filters.
Filtering logic:
- No subscriptions = receive all (default broadcast mode)
- With subscriptions: check if message subject matches any subscription pattern
- Apply payload filters if the client has filters for this subject
Parameters
Section titled “Parameters”subject
Section titled “subject”string | undefined
The message subject (if any)
payload
Section titled “payload”unknown
The message payload (if any)
subscriptions
Section titled “subscriptions”Set<string>
Set of subscription patterns
filters
Section titled “filters”Map<string, PayloadFilter>
Map of payload filters per subject
Returns
Section titled “Returns”boolean
true if the client should receive the message