akka / akka

A platform to build and run apps that are elastic, agile, and resilient. SDK, libraries, and hosted environments.
https://doc.akka.io
Other
13.06k stars 3.59k forks source link

Add Flow#distinctUntilChanged? #32081

Open He-Pin opened 1 year ago

He-Pin commented 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.


  def distinctUtilChanged:Repr[Out] = ???

  def distinctUtilChanged(predicate:(/*old*/ Out, /*new*/ Out) => Boolean):Repr[Out] = ???
patriknw commented 1 year ago

That can be done rather easily with statefulMapConcat?

He-Pin commented 1 year ago

That can be done rather easily with statefulMapConcat?

Yes, but still better to have this out of box, let's wait to see if this can accept more votes.