Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

446 B
Raw Blame
/** Per-list sampling: retain interaction changes/final drag samples, at most 4 Hz otherwise. */
export function createScrollDebugSampler(now = () => performance.now()) {
  let lastAt = -Infinity;
  let lastFlags = -1;
  return (flags: number, finalSample: boolean): boolean => {
    const at = now();
    if (!finalSample && flags === lastFlags && at - lastAt < 250) return false;
    lastAt = at;
    lastFlags = flags;
    return true;
  };
}