Skip to content

Commit

Permalink
docs: Update components/tasks index.mdx useVisibleTask$ (#6255)
Browse files Browse the repository at this point in the history
Co-authored-by: PatrickJS <[email protected]>
  • Loading branch information
Jemsco and PatrickJS authored May 6, 2024
1 parent 83ca896 commit 7ed839f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ const Clock = component$<{ isRunning: Signal<boolean> }>(({ isRunning }) => {
```
</CodeSandbox>
> Notice how the clock's `useVisibleTask$()` does not run until the `<Clock>` component becomes visible. The default behavior of `useVisibleTask$()` is to run the task when the component becomes visible. This behavior is implemented through [intersection observers](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
> Notice how the clock's `useVisibleTask$()` does not run until the `<Clock>` component becomes visible. The default behavior of `useVisibleTask$()` is to run the task when the component becomes visible. This behavior is implemented through [intersection observers](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
> **Note**:
> The [intersection observers](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) will not run on components that are not considered visible such as `<audio />`.
### Option `eagerness`

Expand Down

0 comments on commit 7ed839f

Please sign in to comment.