Home / Function/ scrollInterval() — astro Function Reference

scrollInterval() — astro Function Reference

Architecture documentation for the scrollInterval() function in router.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  129594d7_9bf0_c870_be2d_a82b4a465587["scrollInterval()"]
  2b5c33e2_176e_e839_f05f_7f10493f4f74["router.ts"]
  129594d7_9bf0_c870_be2d_a82b4a465587 -->|defined in| 2b5c33e2_176e_e839_f05f_7f10493f4f74
  8da5c9ab_cf12_edc2_9dbc_d83919b14c0c["onScrollEnd()"]
  129594d7_9bf0_c870_be2d_a82b4a465587 -->|calls| 8da5c9ab_cf12_edc2_9dbc_d83919b14c0c
  style 129594d7_9bf0_c870_be2d_a82b4a465587 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/transitions/router.ts lines 641–659

			const scrollInterval = () => {
				// Check the index to see if a popstate event was fired
				if (lastIndex !== history.state?.index) {
					clearInterval(intervalId);
					intervalId = undefined;
					return;
				}
				// Check if the user stopped scrolling
				if (lastY === scrollY && lastX === scrollX) {
					// Cancel the interval and update scroll positions
					clearInterval(intervalId);
					intervalId = undefined;
					onScrollEnd();
					return;
				} else {
					// Update vars with current positions
					(lastY = scrollY), (lastX = scrollX);
				}
			};

Domain

Subdomains

Frequently Asked Questions

What does scrollInterval() do?
scrollInterval() is a function in the astro codebase, defined in packages/astro/src/transitions/router.ts.
Where is scrollInterval() defined?
scrollInterval() is defined in packages/astro/src/transitions/router.ts at line 641.
What does scrollInterval() call?
scrollInterval() calls 1 function(s): onScrollEnd.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free