Quick Example
useDebouncedState Usage
ตัวอย่าง import และการใช้งานแบบสั้นสำหรับหน้า `use-debounced-state`
Code
<script lang="ts">
import { useDebouncedState } from 'svelora';
const search = useDebouncedState('', 300);
</script>
<input bind:value={search.current} placeholder="Search..." />
<p>{search.debounced}</p>
useDebouncedState
Reactive state whose debounced mirror lags behind current by a
delay — write current from an input and derive from debounced,
with no manual two-state wiring.
Debounced filter (delay: 300ms)
current updates on every keystroke; the list re-filters only once typing settles.
current: "" debounced: ""
- Apple
- Banana
- Blueberry
- Cherry
- Grape
- Mango
- Orange
- Peach
- Pear
- Pineapple
- Strawberry
- Watermelon