publish(eventType, payload)
Invokes all items subscribed to a specific type of event and passes the specified payload to the subscribed items.
Returns
Not applicable.
Parameters
Name | Type | Description | Required |
eventType | string | The type of event whose subscribed events must be invoked. | ✅ |
payload | object | The information that must be passed to the subscribed items. | ✅ |
Usage example
In this example, the API invokes all items subscribed to the event type and passes the payload to the items.
PCore.getPubSubUtils().publish(eventType,payload);
Previous topic cleanContextSubscribers(contextName) Next topic subscribe(eventType, subscriptionItem, subscriptionItemName, subscribeOnce, contextName)