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

Use better binding transformations where possible #141

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

stephencelis
Copy link
Member

Binding.init(get:set) is handy but buggy when it comes to preserving animations and passing in the correct transaction. We can preserve the binding's transaction in a less buggy manner by leveraging dynamic member lookup instead, a trick we've employed in TCA, but never here.

Note that it's not always possible to employ this trick:

  • When the base type can be anything, there's nothing we can extend, so no _printChanges.
  • When trying to override when a value is set, so no removeDuplicates.

`Binding.init(get:set)` is handy but buggy when it comes to preserving
animations and passing in the correct transaction. We can preserve the
binding's transaction in a less buggy manner by leveraging dynamic
member lookup instead, a trick we've employed in TCA, but never here.
@stephencelis stephencelis merged commit d9e72f3 into main Jan 30, 2024
4 checks passed
@stephencelis stephencelis deleted the better-binding-transformations branch January 30, 2024 21:06
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