Seitu - Type-Safe Utilities
Core

Debounce Fn

createDebounceFn()

Wraps a plain function in a debounced callable that also acts as a subscribable.

Each call resets the debounce timer. When the timer fires, the wrapped function is invoked and its return value becomes the current state, notifying subscribers.

Examples

import {  } from 'seitu'

const  = ((: string) => (`/api?q=${}`), 300)
.( => .('result:', ))
('hello') // debounced — fires after 300ms of inactivity
.() // latest return value (undefined until first call)

On this page