From 9828828bdf10cd115fc448dc15ea7036fc1b8273 Mon Sep 17 00:00:00 2001 From: Margarida Silva Date: Tue, 16 Jan 2024 11:49:56 +0000 Subject: [PATCH] [fix](docs): fix wrong params and definition for use-debounce ISSUES CLOSED: #484 --- .../routes/composables/use-debounce/+page.md | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/docs/src/routes/composables/use-debounce/+page.md b/apps/docs/src/routes/composables/use-debounce/+page.md index 251d6ac0..4a193a0b 100644 --- a/apps/docs/src/routes/composables/use-debounce/+page.md +++ b/apps/docs/src/routes/composables/use-debounce/+page.md @@ -10,9 +10,9 @@ source: 'svelteui-composables/src/utilities/use-debounce/use-debounce.ts' --- @@ -28,12 +28,17 @@ source: 'svelteui-composables/src/utilities/use-debounce/use-debounce.ts' ## Params -| Param | Description | -| -------- | ------------------------------------------------------ | -| fn | A function to be executed after delay milliseconds. | -| ms | A zero-or-greater delay in milliseconds. | -| trailing | If true, call fn again after the time is up. | -| leading | If true, call fn on the leading edge of the ms timeout | +| Param | Description | +| ------- | ----------------------------------------------------------------- | +| fn | A function to be executed after delay milliseconds. | +| ms | A zero-or-greater delay in milliseconds. | +| options | An object that contains options to control the debounce behavior. | + +Options: + +| Param | Description | +| ------- | ---------------------------------------------------------------------------- | +| maxWait | The maximum time allowed to be delayed before it's invoked, in milliseconds. | ## Definition @@ -41,7 +46,6 @@ source: 'svelteui-composables/src/utilities/use-debounce/use-debounce.ts' export function useDebounce( fn: T, ms?: number, - trailing?: boolean, - leading?: boolean + options?: { maxWait?: number} ): T; ```