UNPKG

@empathyco/x-components

Version:
69 lines (32 loc) 1.04 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [useEmitDisplayEvent](./x-components.useemitdisplayevent.md) ## useEmitDisplayEvent() function Composable that emits a `TrackableElementDisplayed` event whenever the provided element appears in the viewport for the first time. **Signature:** ```typescript export declare function useEmitDisplayEvent(input: UseEmitDisplayEventOptions): UseOnDisplayReturn; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> { element, taggingRequest, eventMetadata, } </td><td> (not declared) </td><td> </td></tr> <tr><td> input </td><td> UseEmitDisplayEventOptions </td><td> </td></tr> </tbody></table> **Returns:** UseOnDisplayReturn If the element is currently visible in the viewport or not and the watcher stop handle.