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

x/blocks/utils/async.ts>throttle

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
variable throttle
import { throttle } from "https://deno.land/x/blocks@1.100.1/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