Notification Manager

A notification manager used to create Notifications to be shown to the user.

An instance of this class is always available as the inkdrop.notifications global.

Events

::onDidAddNotification(callback)

Invoke the given callback after a notification has been added.

Argument Description
callback(notification) Function to be called after the notification is added.
 notification The Notification that was added.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

::onDidClearNotifications(callback)

Invoke the given callback after the notifications have been cleared.

Argument Description
callback() Function to be called after the notification is cleared.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

Adding Notifications

::addSuccess(message, [options])

Add a success notification.

Argument Description
message A String message
options An options Object with the following keys:
 .dismissable A Boolean indicating whether this notification can be dismissed by the user. Defaults to false.
 .detail A string containing a longer description about the notification.

Return values

Returns the Notification that was added.

::addInfo(message, [options])

Add an informational notification. See ::addSuccess for arguments.

::addWarning(message, [options])

Add a warning notification. See ::addSuccess for arguments.

::addError(message, [options])

Add an error notification. See ::addSuccess for arguments.

::addFatalError(message, [options])

Add a fatal error notification. See ::addSuccess for arguments.

Getting Notifications

::getNotifications()

Get all the notifications.

Return values

Returns an Array of Notifications.

Can you help us improve these docs?

The source of these docs is here on GitHub. If you see a way these docs can be improved, please fork us!