es-toolkit icon indicating copy to clipboard operation
es-toolkit copied to clipboard

chore(debounce): fix types

Open dayongkr opened this issue 1 year ago • 2 comments

Description

Before the changes, return type used a Template type F, but we don't return a func function.

Actually, we return a debounced function. So, I change return type.

And more accuracy, I change type of extends target and add a test case.

Before

Screenshot 2024-08-20 at 4 39 21 PM

Correct return type is (a: number) => void) & { cancel: () => void; }, but before type inference is not.

After

Screenshot 2024-08-20 at 4 42 45 PM

dayongkr avatar Aug 20 '24 07:08 dayongkr

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 2:01am

vercel[bot] avatar Aug 20 '24 07:08 vercel[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.77%. Comparing base (367fc87) to head (094c8b3). Report is 699 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #406   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files         165      165           
  Lines        1321     1321           
  Branches      357      357           
=======================================
  Hits         1318     1318           
  Misses          2        2           
  Partials        1        1           
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar Aug 20 '24 07:08 codecov-commenter