StreamUtils<T> extension

Extension for safely retrieving the first element from a Stream<T>.

This prevents errors when calling .first on an empty stream.

on

Methods

firstOrNull() Future<T?>

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

Returns the first element of the stream, or null if the stream is empty.