Caplin Trader 4.8.0

Interface: module:caplin/alerts/NotificationService

module:caplin/alerts/NotificationService

The NotificationService provides access to the user's module:caplin/alerts/Notifications.

This service can be accessed from the module:br/ServiceRegistry, using the alias caplin.alerts.notification-service. There is no default implementation for this service.

This interface uses emitr allowing services implementing this interface to trigger events.

The service will emit events defined in module:caplin/alerts/NotificationServiceEvents.

Members

status

Methods

dismiss(notification, erroropt, successopt)

A request to dismiss the given notification, removing it from the user's list of notifications.

If the request is successful, a REMOVED event will be raised (see module:caplin/alerts/NotificationServiceEvents).

Parameters:
Name Type Attributes Description
notification module:caplin/alerts/Notification The notification to dismiss.
error function <optional>
A callback that will be invoked if the request fails.
success function <optional>
A callback that will be invoked when the request succeeds.

dispose()

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

getNotificationsCount() → {Number}

Returns a count of the currently active notifications.
Returns:
number of currently active notifications.
Type
Number