Caplin Trader 4.8.0

Class: module:caplin/sljsadapter/providers/StreamLinkNotificationService

module:caplin/sljsadapter/providers/StreamLinkNotificationService

The StreamLinkNotificationService is a wrapper around streamlink's alerts module that translates notification objects from streamlink into module:caplin/alerts/Notification objects and sends them to any components that are listening via the emitr on method. This class listens to the streamlink alerts API. It implements the module:caplin/alerts/NotificationService interface.

Constructor

new module:caplin/sljsadapter/providers/StreamLinkNotificationService(providedStreamlinkNotificationAPIopt)

Parameters:
Name Type Attributes Default Description
providedStreamlinkNotificationAPI caplin.streamlink.alerts.NotificationService <optional>
new caplin.streamlink.alerts.NotificationService() provide a fake streamlink API for testing

Methods

dismiss(dismissedNotification, erroropt, successopt)

This method is meant to be invoked by UI components wishing to dismiss a notification. It uses the streamlink API to dismiss the given notification.
Parameters:
Name Type Attributes Description
dismissedNotification caplin/alerts/Notification The notification to be dismissed.
error function <optional>
Callback to be invoked on streamlink contrib error.
success function <optional>
Callback to be invoked on successful request.
See:
Throws:
If dismissedNotification is not a Notification or if error and success are not functions.
Type
br/Errors.InvalidParametersError

dispose()

Disposes of any listeners and resources that were used by the service.