Loading homepage
Input: const next = limit(() => ++count, 2); // count starts at 0; next(); next(); next(); Output: 1, 2, 2; callback runs twice.
Input: const disabled = limit(() => 10, 0); disabled(); Output: undefined
A callback wrapper with a fixed attempt budget and a cached last successful result.