1st class ArrayObserver support in Polymer?

131 views
Skip to first unread message

Eric Bidelman

unread,
Mar 10, 2014, 1:29:58 PM3/10/14
to polymer-dev
We added 1st class support for PathObserver:
http://www.polymer-project.org/docs/polymer/polymer.html#observeblock

Is there similar support for observing array properties?

-eb

Steve Orvell

unread,
Mar 11, 2014, 9:58:39 PM3/11/14
to Eric Bidelman, polymer-dev
Array valued properties in polymer-elements are automatically array-observed. The *Changed method is called when the array length changes.


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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CACGqRCCEjk5H0t_VwAFKMrA_2ZtSA_Bx%3DaEX8Q9em-TuGrukwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

mich...@chromium.org

unread,
Mar 6, 2015, 9:04:44 PM3/6/15
to polym...@googlegroups.com, ebi...@gmail.com
Sorry to resurrect an old thread. Is this documented anywhere?

For array properties, the *Changed method is invoked in two different ways -- when the property itself is changed (i.e. set to a different array), the function is called with the standard arguments (newValues, oldValues, paths), but when the array is modified with methods from Array.prototype, the *Changed method is called with a single parameter (splices).

Is the behavior I'm seeing guaranteed for arrays? Will this change in 0.8?

Thanks!
Michael
Reply all
Reply to author
Forward
0 new messages