-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 📝 Update documentation structure and layout
- Loading branch information
1 parent
2ef1076
commit 32aa170
Showing
25 changed files
with
202 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
layout: default | ||
title: Callbacks / Functions | ||
nav_order: 3 | ||
has_children: true | ||
--- | ||
|
||
# Timeouts | ||
|
||
React hooks that return some form of timed callback. | ||
{: .fs-6 .fw-300 } | ||
|
||
Most of these callbacks are based on [setTimeout()][timeout-mdn]. | ||
|
||
For *rate-limiting* use `useThrottle()` or `useDebounce()`. For *pure timeouts* use `useTimeout()` or `useTimeoutEffect()`. | ||
|
||
{: .note } | ||
All of these hooks are memoized and will automatically take care of clearing any pending timeouts on unmount. | ||
|
||
[timeout-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/setTimeout |
8 changes: 5 additions & 3 deletions
8
docs/animation-api/useAnimationFrame.md → docs/callbacks/useAnimationFrame.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dle-callback-api/useIdleCallbackEffect.md → docs/effects/useIdleCallbackEffect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: useIdleCallbackEffect | ||
parent: Idle Callbacks | ||
parent: Effects | ||
nav_order: 2 | ||
--- | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
docs/timeouts-api/useTimeoutEffect.md → docs/effects/useTimeoutEffect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: useTimeoutEffect | ||
parent: Timeouts | ||
parent: Effects | ||
nav_order: 1 | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,55 @@ | ||
--- | ||
layout: default | ||
title: List of all hooks | ||
nav_order: 7 | ||
nav_order: 6 | ||
has_children: false | ||
--- | ||
|
||
# List of all hooks | ||
# A list of all hooks | ||
|
||
In case you wonder where to find them. | ||
{: .fs-6 .fw-300 } | ||
|
||
## Base Vanilla JS wrappers | ||
## By Javascript function | ||
|
||
#### Set Timeout | [MDN][timeout-mdn] | ||
- [useTimeout](/react-timing-hooks/timeouts-api/useTimeout.html) | ||
- [useTimeoutEffect](/react-timing-hooks/timeouts-api/useTimeoutEffect.html) | ||
|
||
#### Set Interval | [MDN][interval-mdn] | ||
- [useInterval](/react-timing-hooks/intervals-api/useInterval.html) | ||
- [useIdleCallback](/react-timing-hooks/idle-callback-api/useIdleCallback.html) | ||
|
||
#### Request Idle Callback | [MDN][idle-cb-mdn] | ||
- [useIdleCallback](/react-timing-hooks/idle-callback-api/useIdleCallback.html). | ||
- [useIdleCallbackEffect](/react-timing-hooks/idle-callback-api/useIdleCallbackEffect.html) | ||
|
||
#### Request Animation Frame | [MDN][raf-mdn] | ||
- [useAnimationFrame](/react-timing-hooks/animation-api/useAnimationFrame.html) | ||
- [useAnimationFrameLoop](/react-timing-hooks/animation-api/useAnimationFrameLoop.html) | ||
|
||
## By Use Case | ||
## By use case | ||
|
||
### Rate Limiting, Throttling, Debouncing | ||
#### Rate limiting / throttling / debouncing | ||
- [useThrottledState](/react-timing-hooks/general-utility/useThrottledState.html) - tame rapid firing state updates, reducing the number of React updates | ||
- [useThrottle](/react-timing-hooks/timeouts-api/useThrottle.html) | ||
- [useDebounce](/react-timing-hooks/timeouts-api/useDebounce.html) | ||
|
||
### Counting | ||
#### Reactive counters & timers | ||
- [useCounter](/react-timing-hooks/intervals-api/useCounter.html) - a reactive, customizable counter | ||
- [useTimer](/react-timing-hooks/intervals-api/useTimer.html) - a timer | ||
- [useCountdown](/react-timing-hooks/intervals-api/useCountdown.html) - a countdown (ends automatically) | ||
|
||
### Rendering | ||
#### GFX / animation / rendering | ||
- [useAnimationFrameLoop](/react-timing-hooks/animation-api/useAnimationFrameLoop.html) - for animations, rendering etc. | ||
|
||
### Time | ||
#### Time | ||
- [useClock](/react-timing-hooks/intervals-api/useClock.html) - displays a real-time digital clock | ||
|
||
### Tracking | ||
#### Tracking | ||
- [useIdleCallback](/react-timing-hooks/idle-callback-api/useIdleCallback.html)** | ||
|
||
|
||
[interval-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/setInterval | ||
[timeout-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/setTimeout | ||
[idle-cb-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback | ||
[raf-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame |
Oops, something went wrong.