Open GrandSchtroumpf opened 1 year ago
@wmertens According to mhevery this is how it's working "for now" :
Once the app is running in the client useVisibleTask executes eagerly.
From his comment
I think it can be confusing as developer might think it always execute code when the element enters the viewport.
Is there any update?
We are thinking of making it lazy, but it is dependant on other features landing first.
is this still valid?
Is your feature request related to a problem?
Currently
useVisibleTask$
runs:<a>
)<Link>
)This means that we cannot rely on it to lazy query data for example, as it'll be trigger eagerly with soft navigation.
Describe the solution you'd like
As qwik loader already has an
IntersectionObserver
, I think it could trigger a callback when the element is visible.Describe alternatives you've considered
Create a local hook for that, but it might be difficult to optimize.
Additional context
No response