MCPcopy Create free account
hub / github.com/evolify/dumpfun / throttle

Function throttle

common/hooks/table.ts:3–12  ·  view source on GitHub ↗
(fn: (args: any) => void, delay: number)

Source from the content-addressed store, hash-verified

1import { useEffect, useRef } from "react"
2
3function throttle(fn: (args: any) => void, delay: number) {
4 let lastTime = 0
5 return (args: any) => {
6 const now = Date.now()
7 if (now - lastTime > delay) {
8 fn(args)
9 lastTime = now
10 }
11 }
12}
13
14function cloneHeader(table: HTMLTableElement) {
15 if (document.getElementById("fixed-header")) {

Callers 1

useStickyTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected