Caplin Trader 5.1.0

Class: module:ct-sljsadapter/providers/StreamLinkNotificationService

module:ct-sljsadapter/providers/StreamLinkNotificationService(providedStreamlinkNotificationAPI)

The StreamLinkNotificationService is a wrapper around streamlink's alerts module that translates notification objects from streamlink into module:ct-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:ct-alerts/NotificationService interface.

Constructor

new module:ct-sljsadapter/providers/StreamLinkNotificationService(providedStreamlinkNotificationAPI)

Parameters:
Name Type Description
providedStreamlinkNotificationAPI 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 ct-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.