Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add useDebouncedValue hook #104

Merged
merged 3 commits into from
Aug 6, 2024
Merged

feat: add useDebouncedValue hook #104

merged 3 commits into from
Aug 6, 2024

Conversation

thebuilder
Copy link
Contributor

@thebuilder thebuilder commented Aug 5, 2024

Add a useDebouncedValue hook, to make it easy to lazy set values.

It's not possible to cancel/flush pending updates to the value. Not sure if it makes sense to include that

Copy link

pkg-pr-new bot commented Aug 5, 2024

commit: b889fb0

pnpm add https://pkg.pr.new/charlie-tango/hooks/@charlietango/hooks@104

Open in Stackblitz

Copy link

github-actions bot commented Aug 5, 2024

size-limit report 📦

Path Size
use-debounced-callback 170 B (0%)
use-element-size 264 B (0%)
use-media 245 B (0%)
use-previous 239 B (0%)
use-script 275 B (0%)
use-window-size 85 B (0%)
use-debounced-value 213 B (+100% 🔺)

@thebuilder thebuilder requested a review from fbosch August 5, 2024 15:05
Copy link

@fbosch fbosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good without manual cancellability

@thebuilder thebuilder merged commit 4118c3d into main Aug 6, 2024
12 checks passed
@thebuilder thebuilder deleted the feat/debounced-value branch August 6, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants