@webdeveric/utils
    Preparing search index...

    Function getDelay

    • Resolve delay to a number of milliseconds, calling it with context if it's a function.

      Parameters

      Returns number

      const context = { callCount: 2, lastCall: Date.now(), data: {}, options: { delay: 100 } };

      getDelay(100, context); // 100
      getDelay((ctx) => ctx.callCount * 50, context); // 100