Subscribe to platform events from your extension
Platforms have the ability to send event notifications that you can subscribe to from your extension with the platformEventNotification
capability. When you subscribe to an event name, your function will be executed each time the platform sends out a notification that the specific platform event has occurred.
Optionally, the platform may pass a generic data object specific to the event to your subscribed function as an argument.
For a full list of events you can subscribe to in UUX, please see the SDK Documentation on UUX Payloads.
Type
tecton.sources.platformEventNotification(eventName: string, fn: () => void): () => void;
Example
tecton.sources.platformEventNotification('EXAMPLE_EVENT', function(data) {
tecton.actions.showAlert({
message: `Platform Event Received: ${data}`,
styleType: 'info',
durationInMs: 3000
});
});
The name of the platform event notification you want to subscribe to.
The function you want executed when the platform event notification you are subscribed to is emitted.
Initial Release