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

review: deferred updating of html dom in renderers #85

Open
gabor-farkas opened this issue Jan 22, 2015 · 0 comments
Open

review: deferred updating of html dom in renderers #85

gabor-farkas opened this issue Jan 22, 2015 · 0 comments

Comments

@gabor-farkas
Copy link

Related to #72

  1. the user clicks the checkbox
  2. the model value is set to true
  3. the presenter binding listener is invoked, and the presenter value is set to true
  4. the application code is invoked, and the presenter value is set to false
  5. the presenter binding listener is invoked, and the model value is set to false
  6. the renderer reacts to the model value change and unchecks the checkbox in the dom. This is the bottom of the orignial call stack.
  7. now the methods return in the stack to 3)
  8. After the presenter binding is invoked, the renderer listener is invoked with the original true value, so the dom is updated to the checked value.

This causes that the checkbox remains checked, although the presenter logic updated the viewmodel to false. This is because the event loopback is at the top of the stack.
#72 was solved by changing the way the renderer handles model changes: it doesn't instanlty update the html dom, but defers and udpater. The updater will rely on the model value, so it passes by any transient change. This ensures that the correct viewmodel value will be reflected in the html dom.

We'll need to revise other renderers to conform this scenario.

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