Skip to content

Commit

Permalink
[fix](docs): fix wrong params and definition for use-debounce
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #484
  • Loading branch information
BeeMargarida committed Jan 16, 2024
1 parent 6c4c768 commit 9828828
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions apps/docs/src/routes/composables/use-debounce/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ source: 'svelteui-composables/src/utilities/use-debounce/use-debounce.ts'
---

<script lang='ts'>
import { Demo, ComposableDemos } from '@svelteuidev/demos';
import { Heading } from "$lib/components";
import { base } from '$app/paths';
import { Demo, ComposableDemos } from '@svelteuidev/demos';
import { Heading } from "$lib/components";
import { base } from '$app/paths';
</script>

<svelte:head>
Expand All @@ -28,20 +28,24 @@ 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

```js
export function useDebounce<T extends FunctionArgs>(
fn: T,
ms?: number,
trailing?: boolean,
leading?: boolean
options?: { maxWait?: number}
): T;
```

0 comments on commit 9828828

Please sign in to comment.