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

x/live/utils/async.ts>throttle

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Latest
variable throttle
import { throttle } from "https://deno.land/x/live@1.107.0/utils/async.ts";

Allow one concurrent cb to be running.

If cb is called again while it is running, it will be queued and run after the current cb is done. If there are already any cb queued, these queued cb will be ignored and only the last cb will be run.

type

(cb: () => Promise<void>) => unknown