Initializes the Donation Alerts events client.
Configuration for creating the EventsClient
.
Readonly
onFires when a user's client successfully connects to the Centrifugo server.
Readonly
onFires when a user's client disconnected from the Centrifugo server.
Registers a user with the client and creates a new UserEventsClient for them.
The ID of the user to register.
A UserEventsClient instance for the registered user.
Returns an instance of UserEventsClient for a specific user.
The ID of the user to retrieve the client instance for.
Checks if a user is registered in the client.
The user ID to check for registration.
true
if the user is registered; otherwise, false
.
Subscribes to donation events for a specific user.
The ID of the user whose donations are being monitored.
A function invoked when a donation event is received.
An EventsListener instance for managing the subscription.
Subscribes to goal update events for a specific user.
The ID of the user whose goal updates are being monitored.
A function invoked when a goal update event is received.
An EventsListener instance for managing the subscription.
Subscribes to poll update events for a specific user.
The ID of the user whose poll updates are being monitored.
A function invoked when a poll update event is received.
An EventsListener instance for managing the subscription.
Unregisters a user and removes their listeners and event subscriptions.
The ID of the user to remove.
Donation Alerts events client that manages multiple users and allows listening to various events such as donations, goal updates, and poll updates.
Remarks
The
EventsClient
acts as a central manager for event subscriptions. Each user tracked by the client operates within its own UserEventsClient instance. This class simplifies handling multiple users while maintaining individual event subscription control.