I could also see the log output being reasonable.  But that gets at the 
question behind the question, which is this:  How can I observe a change 
caused by an actual edit of an item of the list, and not a reassignment of 
the data objects to the element instances that is causes by things like 
unshift, sort, or filter?  That distinction is really what I'm interested 
in.

On Saturday, March 4, 2017 at 9:34:31 PM UTC-7, Santanu Basu wrote:
>
> I have posted this in another form on SO (
> http://stackoverflow.com/questions/42565640/how-to-distinguish-between-structural-changes-to-array-made-in-parent-element-vs)
>  
> and in the 2.0-preview branch slack channel, but I know they are heads down 
> with the upcoming release, so hopefully somewhere in the broader group here 
> will have insight to share.
>
> The TL;DR question: how many times should the observer, defined in 
> editor-element.html log to console for the following sample code: 
> https://plnkr.co/edit/iTZqM4GwpASEqQgtRGEk?  I would have expected 4, but 
> it actually happens 6 times.
>
> More details: the elements are a list element which, using dom-repeat, 
> renders a list of todos, and each todo is rendered by an instance of an 
> editor element.  The data is a list of todo objects, each of which has a 
> primitive property called description.  First, two todo objects are pushed 
> onto the list.  Then the first todo object's description property is 
> edited.  Then a third todo object is unshifted (not pushed) onto the list. 
>  The data binding is defined two way between the items inside the 
> dom-repeat of the list element and the todo property of the editor element. 
>  In other words, the binding is made at the object, not the property.  The 
> editor element defines an observer on "todo.description", printing a 
> message to the console each time an observation is made.
>
> thanks in advance for any help
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to polymer-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/f1383f98-64b5-4030-b3e7-42a1529539c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to