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

Suggested copy edits to 2 way binding article. #2

Merged
merged 1 commit into from Jun 9, 2014

Conversation

asolove
Copy link
Contributor

@asolove asolove commented Jun 9, 2014

No description provided.

@@ -322,10 +322,10 @@ <h2 id="meteor">Meteor</h2>


<h2>Summary</h2>
<p>Backbone doesn’t support two-way data binding out of the box, it’s the only library here that overwrites currently edited input field with the same value.</p>
<p>Backbone doesn’t support two-way data binding out of the box. It’s the only library here that overwrites the currently edited input field with the same value.</p>
<p>React’s virtual DOM works well in most cases but needs some massaging when dealing with floating point numbers.</p>
Copy link
Contributor Author

@asolove asolove Jun 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this isn't quite right. The virtual DOM is working fine. What this illustrates is actually an issue with React's philosophy of only storing the minimum of state and re-calculating as much as possible on the fly rather than storing lots of state and using bindings to sync it. If you show, and let users edit, calculated values rather than stored ones, you need to have functions a->b and b->a that work precisely, so that a->b->a is always exactly a.

If you don't, you'll need to do something like storing both pieces of state and updating one when the other changes.

Copy link
Owner

@NV NV Jun 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5e0bbaa Any better?

NV added a commit that referenced this issue Jun 9, 2014
Suggested copy edits to 2 way binding article.
@NV NV merged commit e5697d1 into NV:master Jun 9, 2014
@NV
Copy link
Owner

NV commented Jun 9, 2014

Thanks a lot!

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.

None yet

2 participants