Skip to content

Function: shouldReceiveMessage()

Makaio Framework


Makaio Framework / bus-core / 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

string | undefined

The message subject (if any)

unknown

The message payload (if any)

Set<string>

Set of subscription patterns

Map<string, PayloadFilter>

Map of payload filters per subject

boolean

true if the client should receive the message