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

jidejs/ui/bind should update on animation frame #13

Closed
pago opened this issue Jan 28, 2014 · 1 comment
Closed

jidejs/ui/bind should update on animation frame #13

pago opened this issue Jan 28, 2014 · 1 comment
Assignees
Milestone

Comments

@pago
Copy link
Collaborator

pago commented Jan 28, 2014

In order to prevent useless updates of the DOM, it would be favorable if jidejs/ui/bind scheduled its updates on the browser render loop (using requestAnimationFrame).

This will require a few changes to Observable.computed to allow manual dependency management in addition to the automatic one (we need to calculate dependencies in an async callback).

@ghost ghost assigned pago Jan 28, 2014
@pago
Copy link
Collaborator Author

pago commented Feb 6, 2014

Turns out that there wasn't really much to change after all. By making the binding observable lazy, we make sure it is only ever computed (and its dependencies reevaluated) when we need to. Thus, we just need to delay that to the animation frame (using subscribe).

I'm leaving this open to expand it to the foreach binding where we need to buffer the changes of the ObservableList.

pago added a commit that referenced this issue Feb 6, 2014
@pago pago closed this as completed Feb 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant