UNPKG

@empathyco/x-components

Version:
37 lines (25 loc) 1.37 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [useScroll](./x-components.usescroll.md) ## useScroll() function Composable to share Scroll logic. **Signature:** ```typescript export declare function useScroll(props: { distanceToBottom: number; firstElementThresholdPx: number; throttleMs: number; resetOnChange: boolean; resetOn: XEvent | XEvent[]; }, { emit }: SetupContext<any>, scrollEl: Ref<HTMLElement | undefined>): { throttledStoreScrollData: import("vue").ComputedRef<import("../..").ThrottleFunction<[]>>; }; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | props | { distanceToBottom: number; firstElementThresholdPx: number; throttleMs: number; resetOnChange: boolean; resetOn: [XEvent](./x-components.xevent.md) \| [XEvent](./x-components.xevent.md)<!-- -->\[\]; } | Composable props. | | { emit } | SetupContext&lt;any&gt; | | | scrollEl | Ref&lt;HTMLElement \| undefined&gt; | The scrolling container reference. | **Returns:** { throttledStoreScrollData: import("vue").ComputedRef&lt;import("../..").[ThrottleFunction](./x-components.throttlefunction.md)<!-- -->&lt;\[\]&gt;&gt;; } A throttled version of the function to store the scroll data.