This repository was archived by the owner on Apr 12, 2024. It is now read-only.
perf(select): Execute render after $digest cycle#8825
Closed
wesleycho wants to merge 2 commits into
Closed
Conversation
This is an optimization to defer execution of the render function in the select directive after the $digest cycle completes inside the $watchCollection expressions. This does a check to see if the render function is already registered in the $$postDigestQueue before it passes it into $$postDigest, guaranteeing that the DOM manipulation happens only in one execution after the model settles.
Contributor
There was a problem hiding this comment.
instead of doing indexOf you could just have a internal boolean flag renderScheduled and set it to true when you schedule via postDigest and in postDigest reset it to false.
Add reset of toggle
c687b77 to
4c3d9bf
Compare
Contributor
There was a problem hiding this comment.
this should be the first thing in the render method in case an exception is thrown in the body
Contributor
|
thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an optimization to defer execution of the render function in the
select directive after the $digest cycle completes inside the
$watchCollection expressions. This does a check to see if the render
function is already registered in the $$postDigestQueue before it passes
it into $$postDigest, guaranteeing that the DOM manipulation happens
only in one execution after the model settles.