import { limitInvocations } from "https://deno.land/x/froebel@v0.19.0/function.ts";
Returns a version of the function fun
that can only be invoked limit
times.
An optional except
function will be called with the same parameters on any
additional invocations.
If fun
returns anything but void
(or Promise<void>
), supplying an
except
function is mandatory.
The except
function must have the same return type as fun
, or — if fun
returns a promise — it may return the type that the promise resolves to
synchronously.
The except
function may also throw instead of returning a value.