Open He-Pin opened 1 year ago
Motivation: I find this pattern in some of our internal codebase, which is more like statefulMap(..).collect{case Some(x) => x} and I find the Kotlin has Flow#distinctUntilChanged too.
statefulMap(..).collect{case Some(x) => x}
def distinctUtilChanged:Repr[Out] = ??? def distinctUtilChanged(predicate:(/*old*/ Out, /*new*/ Out) => Boolean):Repr[Out] = ???
That can be done rather easily with statefulMapConcat?
statefulMapConcat
Yes, but still better to have this out of box, let's wait to see if this can accept more votes.
Motivation: I find this pattern in some of our internal codebase, which is more like
statefulMap(..).collect{case Some(x) => x}
and I find the Kotlin has Flow#distinctUntilChanged too.