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

Fix two-way bindings #6

Closed
lorentey opened this issue Oct 23, 2016 · 2 comments
Closed

Fix two-way bindings #6

lorentey opened this issue Oct 23, 2016 · 2 comments

Comments

@lorentey
Copy link
Collaborator

As noted in issue #5, two-way bindings have not yet been updated to support transactional updates.

https://github.com/lorentey/GlueKit/blob/a0ed7f17fe0c05380270554c4ef79151f4cb473e/Sources/UpdatableValue.swift#L151-L171

Update the code to take transactions into account. This is more difficult than it seems! E.g., when b is bound to a, a beginTransaction update from a should immediately trigger the same from b. However, b's resulting beginTransaction message must not loop back to a, even though there is a two-way binding between them!

@lorentey
Copy link
Collaborator Author

Such two-way bindings may not be the correct abstraction; these tweets by @pyrtsa suggest alternative ways to approach the underlying problem.
https://twitter.com/pyrtsa/status/790167771900411905
https://twitter.com/pyrtsa/status/790173012075155457

@lorentey
Copy link
Collaborator Author

lorentey commented Nov 1, 2016

This is now mostly fixed. However, trying to create a two-way binding (or trying to close one down) during an active transaction isn't supported—that would require a nontrivial change to our transaction model.

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

No branches or pull requests

1 participant