Creates batching function that collects items

  • Type Parameters

    • T

    Parameters

    • t: number

      Time window for batching

    • f: (xs: T[]) => void

      Function to process batch

    Returns (x: T) => void

    Function that adds items to batch