-
Notifications
You must be signed in to change notification settings - Fork 2.4k
document notifySplices and fix render; fixes #1439 #1515
Conversation
|
||
Call [`render`](/{{versionPrefix}}/api/#dom-repeat:method-render) to force | ||
a `dom-repeat` template to synchronously render any changes to its data. | ||
Normally changes are batched and rendered asynchronously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the two use cases here:
Hmm... the first one isn't really a use case, it's more of a general description. I think you could replace it with these two:
- For unit testing, to ensure items have rendered before checking the generated DOM.
- To ensure a list of items have rendered before scrolling to a specific item.
And explicitly note that it does not cause the dom-repeat to pick up changes to the array that were made without the Polymer array mutation methods. If you (or a third-party library) has mutated the array without using the Polymer array mutation methods, you need to use notifySplices (link to section).
This is one of the #1 things that confuses people about using render.
Done reviewing. Left a few comments. |
OK @arthurevans WDYT? |
* For unit testing, to ensure items have rendered before checking the | ||
generated DOM. | ||
* To ensure a list of items have rendered before scrolling to a | ||
specific item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- To rerun the
sort
orfilter
functions when an a piece of data changes outside the array (for example, sort order or filter criteria).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Caught a couple of other things on 2nd pass. Left comments, otherwise LG. |
document notifySplices and fix render; fixes #1439
@arthurevans WDYT?