MCPcopy
hub / github.com/TanStack/query / Blink

Function Blink

packages/solid-query/src/__tests__/utils.tsx:7–25  ·  view source on GitHub ↗
(
  props: {
    duration: number
  } & ParentProps,
)

Source from the content-addressed store, hash-verified

5import type { MockInstance } from 'vitest'
6
7export function Blink(
8 props: {
9 duration: number
10 } & ParentProps,
11) {
12 const [shouldShow, setShouldShow] = createSignal<boolean>(true)
13
14 createEffect(() => {
15 setShouldShow(true)
16 const timeout = setActTimeout(() => setShouldShow(false), props.duration)
17 onCleanup(() => clearTimeout(timeout))
18 })
19
20 return (
21 <Show when={shouldShow()} fallback={<>off</>}>
22 <>{props.children}</>
23 </Show>
24 )
25}
26
27export function mockOnlineManagerIsOnline(
28 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…