Skip to content

Commit fb0a270

Browse files
authored
refactor(qwik-city): remove unnecessary handling of onQVisible$ (#7593)
1 parent 844ad54 commit fb0a270

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

packages/qwik-city/src/runtime/src/link-component.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
sync$,
77
useSignal,
88
useVisibleTask$,
9-
type QwikVisibleEvent,
109
untrack,
1110
} from '@builder.io/qwik';
1211
import { getClientNavPath, shouldPreload } from './utils';
@@ -86,17 +85,6 @@ export const Link = component$<LinkProps>((props) => {
8685

8786
useVisibleTask$(({ track }) => {
8887
track(() => loc.url.pathname);
89-
if (linkProps.onQVisible$) {
90-
const event = new CustomEvent('qvisible') as QwikVisibleEvent;
91-
92-
if (Array.isArray(linkProps.onQVisible$)) {
93-
linkProps.onQVisible$
94-
.flat(10)
95-
.forEach((handler) => (handler as any)?.(event, anchorRef.value));
96-
} else {
97-
linkProps.onQVisible$?.(event, anchorRef.value!);
98-
}
99-
}
10088
// Don't prefetch on visible in dev mode
10189
if (!isDev && anchorRef.value) {
10290
handlePrefetch?.(undefined, anchorRef.value!);

0 commit comments

Comments
 (0)