distinctBy<S> method
use for FlowR.stream or flowr/FrViewModel.stream
.distinctBy((event) => event.foo)
Implementation
Stream<T> distinctBy<S>([S Function(T event)? field]) {
if (field == null) return distinct();
return map(
(e) => (e, field(e)),
).distinct((p, c) => p.$2 == c.$2).map((event) => event.$1);
}