import {
DialogDestroyedEvent,
PlatformServiceName,
createLogger,
} from '@limetech/lime-web-components';
const logger = createLogger('my-component');
const eventDispatcher = platform.get(PlatformServiceName.EventDispatcher);
eventDispatcher.addListener(
'dialog.destroyed',
(event: DialogDestroyedEvent) => {
logger.debug('Dialog was closed', { dialogId: event.detail });
}
);
Event emitted when a dialog is externally destroyed
This event is dispatched via EventDispatcher when a dialog is closed by external means, such as the user closing a popup window. The event detail contains the dialog ID that was destroyed.
This allows the component that created the dialog to clean up any references or state associated with the dialog.