Members
Methods
# error(notification, options)
Wrapper function for sending a notification with a level of "error".
Can take a Notification object or a string. If a string is provided, it is converted into the message portion of a standard Notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Notification | string | Notification / message to send out to subscribers |
options |
Object | Extra notification options, mostly used by subscribers |
# notify(notification, options)
Wrapper function for sending a notification with a level of "information".
Can take a Notification object or a string. If a string is provided, it is converted into the message portion of a standard Notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Notification | string | Notification / message to send out to subscribers |
options |
Object | Extra notification options, mostly used by subscribers |
# publishNotification(notification, options)
Publish a Notification to all current subscribers. Generates UID for each notification for unique identification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Notification | Notification to send out to subscribers |
options |
Object | Extra notification options, mostly used by subscribers |
# subscribe(id, pushHandle)
Provides the ability for notification consumers to subscribe to the notification engine. Consumers provide a function handle that takes in a Notification object, allowing the consumer to make decisions about how to handle the Notification.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Identity of notification consumer to subscribe to notifications |
pushHandle |
function | Handle to the consumer function that takes in a Notification |
# success(notification, options)
Wrapper function for sending a notification with a level of "success".
Can take a Notification object or a string. If a string is provided, it is converted into the message portion of a standard Notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Notification | string | Notification / message to send out to subscribers |
options |
Object | Extra notification options, mostly used by subscribers |
# unsubscribe(id)
Unsubscribe a consumer from receiving notifications based on the provided ID.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Identity of notification consumer to unsubscribe |
# warn(notification, options)
Wrapper function for sending a notification with a level of "warn".
Can take a Notification object or a string. If a string is provided, it is converted into the message portion of a standard Notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Notification | string | Notification / message to send out to subscribers |
options |
Object | Extra notification options, mostly used by subscribers |