distinctBy<S> method

Stream<T> distinctBy<S>([
  1. S field(
    1. T event
    )?
])

use for FlowR.stream or flowr/FrViewModel.stream

.distinctBy((event) => event.foo)

equals

.map((event) => (event, event.foo))
.distinct()
.map((event) => event.$1)

Implementation

Stream<T> distinctBy<S>([S Function(T event)? field]) =>
    map((e) => (e, field?.call(e))).distinct().map((event) => event.$1);