Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/throttle.ts>ThrottleOptions

A JavaScript extension package for building strong and modern applications.
Latest
interface ThrottleOptions
import { type ThrottleOptions } from "https://deno.land/x/ayonli_jsext@v0.9.72/throttle.ts";

Options for the throttle function.

Properties

duration: number
optional
for: any

Use the throttle strategy for the given key, this will keep the result in a global cache, binding new handler function for the same key will result in the same result as the previous, unless the duration has passed. This mechanism guarantees that both creating the throttled function in function scopes and overwriting the handler are possible.

optional
noWait: boolean

When turned on, respond with the last cache (if available) immediately, even if it has expired, and update the cache in the background.