Open LynnSha1ng opened 5 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
radash-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 21, 2024 3:05am |
@sodiray I would very much like this option.
Timing with leading = true
, in my understanding:
Time: 0ms - - - - 100ms - - - - 200ms - - - - 300ms - - - - 400ms - - - -
throttle Invocations: x x x x - - - - - - - - x x x x x x x x x x - - - - - - - - - - - -
Source Invocations: x - - - - - x - - - - - - x - - - - - - x - - - - - - x - - - - - -
same need + 1. When will this pr be merged?
Hi @LynnSha1ng and @lake2,
The Radashi fork has both a leading
option for debounce
and a trailing
option for throttle
(thanks to @crishoj).
You can use it today by installing the beta release (an official release is pending).
pnpm install radashi@beta
P.S. I wrote about the differences between Radashi and Radash here: https://radashi-org.github.io/blog/vs-radash/
Descriptions
test(curry): add test for
leading
option doc(curry): modify description and examples ofleading
option in functiondebounce
andthrottle
type(curry): extract types of the options object of functiondebounce
andthrottle
as typeDebounceConfig
andThrottleConfig
.Checklist
package.json
has been bumped (matching semver)yarn build
command has been run and to update thecdn
directory/docs
directory) has been updated