(
props: {
duration: number
} & ParentProps,
)
| 5 | import type { MockInstance } from 'vitest' |
| 6 | |
| 7 | export 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 | |
| 27 | export function mockOnlineManagerIsOnline( |
| 28 | value: boolean, |
nothing calls this directly
no test coverage detected
searching dependent graphs…