API Reference

Returns a new version of a function that can only be run a certain number of times

function limit<T extends Func | AsyncFunc>(func: T, limit: number)

const logHello = () => console.log("hello")
const limitedLogHello = limit(logHello, 1)

logHello()
logHello()

//=> "hello"