Stores a callback for each event
The instance of this SDK
getter method for namespace. Provides the salesforce org namespace
setter method for namespace. Set custom namespace
Fires an event to listeners.
Name of the event to fire.
Name of the event to fire.
Payload of the event to fire.
Registers a callback for an event
Name of the event to listen for.
Contains callback function.
Unregisters a callback for an event
Name of the event to unregister from.
Contains callback function, it should refer to same object which is used to register the event.
Returns the version number of SDK.
Returns SDK version number as string
Adds all the enumerable string keyed function properties of a source
object to the sdk prototype.
.extend
should only be used to add new methods and it won't override the existing methods.
Note: If the property already exists, it will be not be added.
Custom functions which are being extended should have proper namespaces to avoid issues during upgrades. When Vlocity releases new changes it won't impact if unique namespaces are used.
Example: myCompanyOrFeatureMethodName
The object of functions
Get a singleton instance of this PubSub.
an instance of this SDK.
Adds all the enumerable string keyed function properties of a source object to the sdk prototype.
.override
method should only be used to override the existing methods and should only be used in rare cases.
Overriding the existing or default methods may cause unintended consequences and may also impact during upgrades.
Please be cautious while using this
The object of functions
Generated using TypeDoc
A basic pub-sub mechanism for sibling component communication.
getting an instance of PubSub
// Obtain a singleton Pub Sub service const pubSubService = PubSub.getInstance();
registering an event
pubSubService.register('click',{ 'click': (function() {alert("clicked")}) })
unregistering the event
pubSubService.unregister('click',{ 'click': (function() {alert("clicked")}) })
firing the event
pubSubService.fire('click', 'click', data, 1000)