MCPcopy Create free account
hub / github.com/TanStack/query / Blink

Function Blink

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

Source from the content-addressed store, hash-verified

17}
18
19export function Blink(
20 props: {
21 duration: number
22 } & ParentProps,
23) {
24 const [shouldShow, setShouldShow] = createSignal<boolean>(true)
25
26 createEffect(() => {
27 setShouldShow(true)
28 const timeout = setActTimeout(() => setShouldShow(false), props.duration)
29 onCleanup(() => clearTimeout(timeout))
30 })
31
32 return (
33 <Show when={shouldShow()} fallback={<>off</>}>
34 <>{props.children}</>
35 </Show>
36 )
37}
38
39export function mockOnlineManagerIsOnline(
40 value: boolean,

Callers

nothing calls this directly

Calls 1

setActTimeoutFunction · 0.70

Tested by

no test coverage detected