Skip to content

refactor(useDebounce, useThrottle): reuse internal implementations for deprecated hooks - #613

Merged
hyesungoh merged 2 commits into
toss:v1-basefrom
Antoliny0919:issue-612
Nov 19, 2026
Merged

hyesungoh merged 2 commits into
toss:v1-basefrom
Antoliny0919:issue-612

Conversation

@Antoliny0919

@Antoliny0919 Antoliny0919 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Refs: #590
Closes: #612

The hooks scheduled for removal duplicated internal implementations that will continue to be used. I removed this duplication by updating the deprecated public hooks to reuse the internal hooks.

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

…r deprecated hooks

- These hooks are deprecated but are still used internally
@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ead5181

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e6a0c6f) to head (ead5181).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           v1-base      #613    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           78        76     -2     
  Lines         2602      2447   -155     
  Branches       825       790    -35     
==========================================
- Hits          2602      2447   -155     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyesungoh hyesungoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since the return type is written out now, DebouncedFunction doesn't need export. could you drop it (like ThrottledFunction) and use the written-out type in the spec? 🙏

export type DebouncedFunction<F extends (...args: CallerTypedArgs) => void> = {
(...args: Parameters<F>): void;
cancel: () => void;
};

expectTypeOf(result.current).toEqualTypeOf<DebouncedFunction<typeof callback>>();

- use an explicit inline type in the type test
- remove the unnecessary export from DebouncedFunction

@hyesungoh hyesungoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

super thanks! 👍

@hyesungoh
hyesungoh merged commit 25e658b into toss:v1-base Nov 19, 2026
19 checks passed
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.

3 participants