Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

document notifySplices and fix render; fixes #1439 #1515

Merged
merged 1 commit into from
Feb 3, 2016
Merged

document notifySplices and fix render; fixes #1439 #1515

merged 1 commit into from
Feb 3, 2016

Conversation

kaycebasques
Copy link
Contributor

@arthurevans WDYT?


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.

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:

#1439 (comment)

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.

@arthurevans
Copy link

Done reviewing. Left a few comments.

@kaycebasques
Copy link
Contributor Author

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.

Choose a reason for hiding this comment

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

  • To rerun the sort or filter functions when an a piece of data changes outside the array (for example, sort order or filter criteria).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

@arthurevans
Copy link

Caught a couple of other things on 2nd pass. Left comments, otherwise LG.

kaycebasques added a commit that referenced this pull request Feb 3, 2016
document notifySplices and fix render; fixes #1439
@kaycebasques kaycebasques merged commit 63c0b0c into Polymer:master Feb 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants