Documentation
    Preparing search index...

    Function find

    • Call the predicate on each chunk in the queue. The first chunk to pass the predicate will be queued and the stream will be terminated.

      Type Parameters

      • In
      • Out

      Parameters

      • predicate: (chunk: In) => chunk is Out

      Returns TransformStream<In, Out>

      --1--2--3--4--5--6-X

      find((x) => x === 6)

      -----------------6-|

      Using type guards will extract the types you want to work with.

      --A--A--A--B--X

      find((x): x is B => x.type === 'b')

      -----------B--|
    • Call the predicate on each chunk in the queue. The first chunk to pass the predicate will be queued and the stream will be terminated.

      Type Parameters

      • In

      Parameters

      • predicate: Predicate<In>

      Returns TransformStream<In, In>

      --1--2--3--4--5--6-X

      find((x) => x === 6)

      -----------------6-|

      Using type guards will extract the types you want to work with.

      --A--A--A--B--X

      find((x): x is B => x.type === 'b')

      -----------B--|