src/main/ts/wrappers/ratelimit.ts
Function ratelimit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ratelimit: IExposedWrapper = adapter((fn: ITarget, opts: IWrapperOpts): IControlled => {
let timeout: TimeoutID | undefined
const { delay, limit, context, rejectOnCancel, limiter } = opts
const _limiter = limiter || new Limiter(normalizeDelay(limit || delay))
const calls: ICallStack = []