Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

subscribeOnce(eventType, subscriptionItem, subscriptionItemName)

Updated on July 20, 2021

Notifies the subscription item only once when a specific type of event occurs.

Returns

Not applicable.

Parameters

NameTypeDescriptionRequired
eventTypestringThe type of event that occurs.
subscriptionItemfunctionThe subscription item that must be notified.
subscriptionItemNamefunctionThe 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)

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us