0.0.2 • Published 1 year ago

svelte-use-debounce v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

svelte-use-debounce

The use directive for debounce.

Installation

npm i svelte-use-debounce

Usage

<script>
    import {debounce} from "svelte-use-debounce";
</script>

<input use-debounce={{ms: 300, callback: (value) => { ... }}} />

Typescript Support

<script lang="ts">
    import {debounce, type DebounceOptions} from "svelte-use-debounce";

    const opts: DebounceOptions = {
        ms: 300,
        callback: (value: string) => {...}
    };
</script>

<input use-debounce={opts} />

Options

OptionTypeDescription
ms?NumberSets the debounce time.
callback(str: string) => void;Callback to run when it debounces
0.0.2

1 year ago

0.0.1

1 year ago