Best practices replaces upward communication with events- when is two way binding appropriate?

11 views
Skip to first unread message

Darin Hensley

unread,
Jan 23, 2018, 7:47:38 PM1/23/18
to Polymer
I have been doing research for Polymer's best practices. Here is what I have so far:

1) Sibling elements do not need to know about each other. They should communicate between a master element:

                          element Master
                          |            |
                     element foo      element bar

2) for downward directional flow, using bindings. So, when element master communicates with element foo, use a one way data binding:

                      <element-master> 
                         <element-foo foo-property="[[masterProperty]]">
                         <element-bar bar-property="[[masterProperty]]">
                      </element-master>

If `element-foo` or `element-bar` send data back upwards, use emit a event. 

This model eliminates the use of two way binding because upward data flow is using events instead of 2 way binding.   My question for #2 is, when is it valid/proper use to use two way data binding? 


Reply all
Reply to author
Forward
0 new messages