Qwik useVisibleTask alert gating after viewport intersection
0 reputation · 18 Jun 2020, 07:42 UTC
Qwik useVisibleTask alert gating after viewport intersection
The goal is to surface browser alerts only when a Qwik component enters the viewport, using useVisibleTask so notifications do not fire during SSR or initial hydration. A reactive store holds pending alert entries, and the task should enqueue an alert only when a new entry exists and visibility is confirmed.
The unresolved constraint is whether useVisibleTask in Qwik 1.x requires an experimental opt-in, and exactly when the callback executes relative to client hydration and first visible paint. It is also unclear whether visibility state resets after client-side navigation and whether pending store entries survive that boundary without re-fetching.
Does useVisibleTask require the qwik-experimental flag in Qwik 1.x? Does the callback run after hydration completes but before the component is scrolled into view? Do pending alert entries in a reactive store persist across navigation when the component remounts?