Skip to content

Commit

Permalink
docs: 📝 Fix effects overview
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLambrecht committed Aug 3, 2024
1 parent 17dc4ac commit 0880f65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/effects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ has_children: true

# Effects

React hooks that wrap [window.requestIdleCallback()][idle-cb-mdn].
React hooks that are based on `useEffect()`.
{: .fs-6 .fw-300 }

All of these hooks will automatically take care of unregistering / cancelling any pending idle callbacks that you started if the component unmounts for example.
These hooks behave like a regular `useEffect` except that you gain access to timeouts etc. in your effect callback.
These timeouts (or idle callbacks) will be managed by react-timing-hooks, i.e. they will also be cleaned up properly.

[idle-cb-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback

0 comments on commit 0880f65

Please sign in to comment.