svelteuidev / svelteui

SvelteUI Monorepo
https://svelteui.dev
MIT License
1.26k stars 62 forks source link

useDebounce arguments implementation/docs mismatch #484

Closed 10-mahmoud closed 5 months ago

10-mahmoud commented 6 months ago

Link to the page where something isn't quite right

https://www.svelteui.org/composables/use-debounce

Exact quote of what is wrong

trailing    If true, call fn again after the time is up.
leading If true, call fn on the leading edge of the ms timeout

The implementation only has an options object, with maxWait as the single parameter. I was actually hoping to use leading, as the current behavior of trailing doesn't feel as responsive.

Loving the library btw, thanks!

Are you willing to create pull request with the fix?

No

BeeMargarida commented 5 months ago

This seems to be a copy-paste error. If you want the trailing/leading behaviour, you can use the useThrottle composable.

BeeMargarida commented 5 months ago

Docs deployed!