MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / useNow

Function useNow

cli/src/hooks/use-now.ts:12–20  ·  view source on GitHub ↗
(intervalMs: number, enabled = true)

Source from the content-addressed store, hash-verified

10 * elapsed-in-queue display.
11 */
12export function useNow(intervalMs: number, enabled = true): number {
13 const [now, setNow] = useState(() => Date.now())
14 useEffect(() => {
15 if (!enabled) return
16 const id = setInterval(() => setNow(Date.now()), intervalMs)
17 return () => clearInterval(id)
18 }, [intervalMs, enabled])
19 return now
20}

Callers 3

FreebuffModelSelectorFunction · 0.90
WaitingRoomScreenFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected