OnStream<T> extension

on

Properties

lastOrNull Future<T?>

Available on Stream<T>, provided by the OnStream extension

Returns the last element of the stream, or null if the stream is empty.
no setter

Methods

mappedLastOrNull<R>(R? mapper(T)) Future<R?>

Available on Stream<T>, provided by the OnStream extension

Maps the elements of the stream to a new type R using mapper. Tracks the mapped values and returns the last non-null mapped value, or null if the stream is empty or if all mapped values were null.