Documentation
    Preparing search index...

    Function debounce

    • Delays queuing until after ms milliseconds have elapsed since the last time this transformer received anything. The queuing behavior is configurable.

      Type Parameters

      • T

      Parameters

      Returns TransformStream<T, T>

      Using the trailing behavior.

      --a-b-c--------------d-----------

      debounce(20)
      // Same as...
      debounce(20, new DebounceTrailingBehavior())

      -------------c---------------d---

      Using the leading behavior.

      --a-b-c--------------d-----------

      debounce(20, new DebounceLeadingBehavior())

      ---a------------------d----------

      Using both leading and trailing behaviors

      --a-b-c--------------d-----------

      debounce(20, [
      new DebounceLeadingBehavior(),
      new DebounceTrailingBehavior()
      ])

      ---a----------c--------d----------