Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Flow#distinctUntilChanged? #32081

Open
He-Pin opened this issue Aug 31, 2023 · 2 comments
Open

Add Flow#distinctUntilChanged? #32081

He-Pin opened this issue Aug 31, 2023 · 2 comments
Labels
0 - new Ticket is unclear on it's purpose or if it is valid or not t:stream

Comments

@He-Pin
Copy link
Member

He-Pin commented Aug 31, 2023

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
Copy link
Member

patriknw commented Sep 1, 2023

That can be done rather easily with statefulMapConcat?

@He-Pin
Copy link
Member Author

He-Pin commented Sep 1, 2023

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.

@johanandren johanandren added 0 - new Ticket is unclear on it's purpose or if it is valid or not t:stream labels Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new Ticket is unclear on it's purpose or if it is valid or not t:stream
Projects
None yet
Development

No branches or pull requests

3 participants