@empathyco/x-components
Version:
Empathy X Components
55 lines (26 loc) • 993 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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({ element, taggingRequest, eventMetadata, }: 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>
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.