subscribeOnce(eventType, subscriptionItem, subscriptionItemName)
Notifies the subscription item only once when a specific type of event occurs.
Returns
Not applicable.
Parameters
Name | Type | Description | Required |
eventType | string | The type of event that occurs. | ✅ |
subscriptionItem | function | The subscription item that must be notified. | ✅ |
subscriptionItemName | function | The unique name or ID used to identify the subscription item. | ✅ |
Usage example
In this example, the API notifies the subscriptionItem
only once
when an event of type eventType
occurs.
PCore.getPubSubUtils().subscribeOnce(eventType,subscriptionItem,subscriptionItemName);
Previous topic subscribe(eventType, subscriptionItem, subscriptionItemName, subscribeOnce, contextName) Next topic unsubscribe(eventType, subscriptionItemName, contextName)