-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
compose: Add types to useDebounce
#32015
Conversation
Size Change: +16 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
Love the work done in this PR to preserve the signature of the debounced function!
I also believe that our docs should be more detailed. We now have two choices:
|
I strongly prefer this option as it also improves the inline auto-complete based documentation, not just the README docs. I'll go ahead and make this change. |
9f54836
to
21ebe47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from one small pending comment, code changes LGTM! Love these types PRs 🙌
…-take-2 * trunk: (57 commits) Image block: fix cover transform and excessive re-rendering (#32102) compose: Add types to useMergeRefs (#31939) Navigation: Fix collapsing regression. (#32081) components: Promote Elevation (#31614) compose: Add types to useReducedMotion and useMediaQuery (#31941) Update the graphic that appears in the Template Editor welcome guide (#32055) Block Navigation: use CSS for indentation with known max indent instead of spacer divs (#32063) Fix broken template part converter modal styles. (#32097) compose: Add types to `usePrevious` (#31944) components: Add ZStack (#31613) components: Fix Shortcut polymorphism (#31555) compose: Add types to `useFocusReturn` (#31949) compose: Add types to `useDebounce` (#32015) List View: Simplify the BlockNavigation component (#31290) Remove query context leftovers (#32093) Remove filter_var from blocks (#32046) Templates: Remove now-obsolete gutenberg_get_template_paths() (#32066) [RNMobile] Enable reusable block only in WP.com sites (#31744) Rename ViewOwnProps to PolymorphicComponentProps (#32053) Rich text: remove inline display warning (#32013) ...
Description
Add types to
useDebounce
. No runtime changes.One question I have is that this basically replicates the "we don't care about these arguments" approach from before but it makes the documentation pretty bad. So the alternative is to explicitly document each of the parameters to
debounce
. It's highly unlikely that the parameters todebounce
are going to change so I think it's safe to do so. What do y'all think? I think it would be a big improvement over what we have now.Part of #18838
How has this been tested?
Type checks pass.
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).