userDidStopWatchingEvent
Indicates that a user has stopped watching an event and cleans up resources.
Overview
When a user stops watching an event, call this method to properly clean up resources and reset the SDK state. This method is typically called when the user navigates away from the event view or closes the application.
Method Signature
userDidStopWatchingEvent(eventID: string): void
Parameters
Parameter | Type | Description |
---|---|---|
eventID | string | The unique identifier for the event that was being watched |
Return Value
This method does not return a value.
Example
import SDK from '@maestro_io/maestro-web-sdk';
// Function to handle user stopping event watching
function stopWatchingEvent(eventID: string) {
// Notify the SDK that the user has stopped watching
SDK.userDidStopWatchingEvent(eventID);
// Perform any additional cleanup in your application
}
// Example of cleanup when component unmounts
function componentWillUnmount() {
if (currentEventID) {
stopWatchingEvent(currentEventID);
}
}
Notes
- Call this method when the user stops watching an event to ensure proper resource cleanup.