MCPcopy Index your code
hub / github.com/TanStack/query / Blink

Function Blink

packages/react-query/src/__tests__/utils.tsx:25–43  ·  view source on GitHub ↗
({
  duration,
  children,
}: {
  duration: number
  children: React.ReactNode
})

Source from the content-addressed store, hash-verified

23}
24
25export function Blink({
26 duration,
27 children,
28}: {
29 duration: number
30 children: React.ReactNode
31}) {
32 const [shouldShow, setShouldShow] = React.useState<boolean>(true)
33
34 React.useEffect(() => {
35 setShouldShow(true)
36 const timeout = setActTimeout(() => setShouldShow(false), duration)
37 return () => {
38 clearTimeout(timeout)
39 }
40 }, [duration, children])
41
42 return shouldShow ? <>{children}</> : <>off</>
43}
44
45export function mockOnlineManagerIsOnline(
46 value: boolean,

Callers

nothing calls this directly

Calls 1

setActTimeoutFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…