Resolve delay to a number of milliseconds, calling it with context if it's a function.
delay
context
const context = { callCount: 2, lastCall: Date.now(), data: {}, options: { delay: 100 } };getDelay(100, context); // 100getDelay((ctx) => ctx.callCount * 50, context); // 100 Copy
const context = { callCount: 2, lastCall: Date.now(), data: {}, options: { delay: 100 } };getDelay(100, context); // 100getDelay((ctx) => ctx.callCount * 50, context); // 100
Resolve
delayto a number of milliseconds, calling it withcontextif it's a function.