ixfx
    Preparing search index...

    Function asResponsive

    • Changes to queue are output as a responsive stream. The stream emits the full data of the queue (first item being the head of the queue) whenever there is an enqueue, remove or clear operation.

      const queue = new QueueMutable();
      const r = asResponsive(queue);
      r.onValue(v => {
      // v is an array of values
      });


      Calling `set()` on the stream enqueues data to the wrapped queue.
      ```js
      r.set([ `1, `2` ]); // Enqueues 1, 2

      @param queue @returns

      Type Parameters

      • T

      Parameters

      Returns {
          set: (data: T[]) => void;
          dispose(reason: string): void;
          isDisposed(): boolean;
          on(handler: (value: Passed<readonly T[]>) => void): Unsubscriber;
          onValue(handler: (value: readonly T[]) => void): Unsubscriber;
      }