Returns an async function that only runs for the first n calls.
n
Number of times function can be called.
Async function to execute.
Async function.
const fn = beforeAsync(2, async () => 'ok');await fn(); // 'ok'await fn(); // 'ok'await fn(); // undefined Copy
const fn = beforeAsync(2, async () => 'ok');await fn(); // 'ok'await fn(); // 'ok'await fn(); // undefined
1.2.0
Returns an async function that only runs for the first
n
calls.