distinctWith<S> method

Stream<S> distinctWith<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<S> distinctWith<S>(S Function(T event) field) =>
    map((e) => (e, field(e))).distinct().map((event) => event.$2);