Skip to content

Commit

Permalink
Use single-property observer to deal better with if=undefined. Fixes #…
Browse files Browse the repository at this point in the history
…1742

This takes advantage of the fact that single property observers are called for each change (including undefined), whereas multi-property observers wait for all properties to be defined.  Since the side-effect of the observe is to queue an async render, there is no real benefit from this being a multi-property observer.  #1946 is open to track a more general fix for this issue.
  • Loading branch information
kevinpschaaf committed Jun 24, 2015
1 parent f62a80d commit fd741bf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib/template/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
*/
'if': {
type: Boolean,
value: false
value: false,
observer: '_queueRender'
},

/**
Expand All @@ -56,7 +57,8 @@
*/
restamp: {
type: Boolean,
value: false
value: false,
observer: '_queueRender'
}

},
Expand All @@ -65,10 +67,6 @@
Polymer.Templatizer
],

observers: [
'_queueRender(if, restamp)'
],

_queueRender: function() {
this._debounceTemplate(this._render);
},
Expand Down

0 comments on commit fd741bf

Please sign in to comment.