* @param {string} bindingValue * @param {boolean} isFirstMutation * @return {boolean} Whether bind should evaluate and apply changes.
(bindingValue, isFirstMutation)
| 30 | * @return {boolean} Whether bind should evaluate and apply changes. |
| 31 | */ |
| 32 | function getUpdateValue(bindingValue, isFirstMutation) { |
| 33 | if (!bindingValue || bindingValue === Binding.REFRESH) { |
| 34 | // default is 'refresh', so check that its not the first mutation |
| 35 | return !isFirstMutation; |
| 36 | } |
| 37 | if (bindingValue === Binding.ALWAYS) { |
| 38 | // TODO(dmanek): add link to amp-render docs that elaborates on performance implications of "always" |
| 39 | user().warn(TAG, 'binding="always" has performance implications.'); |
| 40 | return true; |
| 41 | } |
| 42 | return false; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Returns the non-empty node count in a template (defined as a `template` |
no test coverage detected