takeLast method

Stream<T> takeLast(
  1. int count
)

Emits only the final count values emitted by the source Stream.

Example

Stream.fromIterable([1, 2, 3, 4, 5])
  .takeLast(3)
  .listen(print); // prints 3, 4, 5

Implementation

Stream<T> takeLast(int count) =>
    TakeLastStreamTransformer<T>(count).bind(this);