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

Added distinctObservable() to Delegates #5406

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kwindie
Copy link

@kwindie kwindie commented Feb 17, 2025

Added kotlin.properties.Delegates.distinctObservable delegate.

Delegates.observable is triggered even when the value hasn't changed (set to the same value). This was unintuitive for me, and not mentioned in the docs.
It was still achievable with Delegates.vetoable, but that requires more work for a much needed function like this.
I know we can't change Delegates.observable itself. So, I added distinctObservable, which does what observable should have done (imo).

YouTrack issue

@kwindie kwindie changed the title added distinctObservable() to Delegates Added distinctObservable() to Delegates Feb 17, 2025
@fzhinkin
Copy link
Contributor

@kw-indie please open a YouTrack first (as it is suggested in our contribution guideline), so we can discuss the issue and possible solutions first.

@kwindie
Copy link
Author

kwindie commented Mar 15, 2025

@fzhinkin I was sure this isn't a significant change, so I didn't create an issue.

@fzhinkin
Copy link
Contributor

@kw-indie all functional and behavioral changes, including the introduction of a new API are significant enough to deserve their own dedicated issues. :)

@kwindie
Copy link
Author

kwindie commented Mar 17, 2025

i see. ok, here is the issue KT-76072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants