Returns an async function that only runs after n calls.
n
Number of calls before function executes.
Async function to execute.
Async function.
const fn = afterAsync(3, async () => 'done');await fn(); // undefinedawait fn(); // undefinedawait fn(); // 'done' Copy
const fn = afterAsync(3, async () => 'done');await fn(); // undefinedawait fn(); // undefinedawait fn(); // 'done'
1.2.0
Returns an async function that only runs after
n
calls.