Clears all subscriptions. Useful for cleanup.
OptionalgetOptional: Retrieves historical data. This base implementation is empty. Subclasses might implement this by interacting with repositories.
Optional_filter: FilterTypeOptional_options: { limit?: number; threadId?: string }Notifies all relevant subscribers with new data.
The data payload to send to subscribers.
Optionaloptions: { targetSessionId?: string; targetThreadId?: string }Optional targeting options (e.g., targetThreadId).
OptionalfilterCheck: (data: DataType, filter?: FilterType) => booleanA function to check if a subscription's filter matches the data.
Subscribes a callback function to receive notifications.
The function to call when new data is notified.
Optionalfilter: FilterTypeAn optional filter to only receive specific types of data.
Optionaloptions: { threadId?: string }Optional configuration, like a threadId for filtering.
An unsubscribe function.
A generic class for implementing a publish/subscribe pattern with filtering capabilities. Designed for decoupling components, particularly UI updates from backend events.