@amad3v/solid-echarts - v1.0.2
    Preparing search index...

    Function debounce

    • Creates a debounced version of fn that delays execution until ms milliseconds have elapsed since the last call.

      Type Parameters

      • T extends (...args: unknown[]) => void

      Parameters

      • fn: T

        The function to debounce.

      • ms: number

        Delay in milliseconds. Set to 0 in CreateChartOptions to disable debouncing and call chart.resize() on every observation.

      Returns T

      A debounced version of fn with the same signature.

      Each call resets the timer. The wrapped function only executes after the calls stop for at least ms milliseconds.

      Used internally by createChart to debounce ResizeObserver callbacks - prevents excessive chart.resize() calls during continuous container size changes.

      const debouncedResize = debounce(() => chart.resize(), 100);
      const observer = new ResizeObserver(debouncedResize);
      observer.observe(container);