Home > @uniformdev/design-system > subscribeTopLayerDialog

subscribeTopLayerDialog() function

Subscribe to changes to the topmost open dialog. The listener is invoked immediately with the current top (or null if no dialog is open) so subscribers don't need a separate initial read.

Signature:

Parameters

ParameterTypeDescription
listener(top: HTMLDialogElement | null) => void

Returns:

(() => void)

A teardown function that removes the listener.