MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / tickStreamScrollFollow

Function tickStreamScrollFollow

src/hold-stream.ts:136–147  ·  view source on GitHub ↗
(
  el: HTMLElement,
  state: StreamScrollFollow,
  options?: { thresholdPx?: number; factor?: number },
)

Source from the content-addressed store, hash-verified

134
135/** Poll + follow each animation frame while content streams. */
136export function tickStreamScrollFollow(
137 el: HTMLElement,
138 state: StreamScrollFollow,
139 options?: { thresholdPx?: number; factor?: number },
140): void {
141 const threshold = options?.thresholdPx ?? DEFAULT_STREAM_SCROLL_THRESHOLD;
142 const factor = options?.factor ?? DEFAULT_STREAM_SCROLL_EASE;
143 syncStreamScrollFollow(el, state, threshold);
144 if (!state.paused) {
145 easeScrollToBottom(el, factor);
146 }
147}
148
149/** Attach scroll listeners that keep follow state in sync with user intent. */
150export function bindStreamScrollFollow(

Callers 1

tickFunction · 0.85

Calls 2

syncStreamScrollFollowFunction · 0.85
easeScrollToBottomFunction · 0.85

Tested by

no test coverage detected