useEventSubscriber

This helps you to subscribe to a custom event dispatched through the eventDispatcher

Installation

import { useEventSubscriber } from 'uxp/components';

Signature

function useEventSubscriber(instanceId: string, eventName: string, callback: (data?: { [key: string]: any }) => void): IEventSubscriber

Examples

useEventSubscriber(props.instanceId, "my-custom-event", (data?: any) => {
     console.log(data?.message)
 })

Last updated