Skip to content

Conversation

@armanbilge
Copy link
Member

So that you can derive a signal that only emits updates on changes to the value, as determined by Eq. The default behavior is to emit an update for every set(...).

This is easily implemented via .discrete.changes. .get and .continuous don't need to be changed, since they are based on the current value.

Note: this also illustrates why a changesBy API would not make sense for Signal. Since in those cases the value may have changed, because changesBy is not a "canonical" equality. So then .discrete and .get would be observably inconsistent.

@mpilquist mpilquist merged commit 8e0e2e6 into typelevel:main Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants