diff --git a/CHANGELOG.md b/CHANGELOG.md index 42d8972b3a..5d4f589ce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,7 +117,41 @@ This update to Polymer includes some new [global settings](https://polymer-libra **What does it do?** This setting causes `` and `` not to dispatch `dom-change` events when their rendered content is updated. If you're using lots of `` and `` but not listening for these events, this setting lets you disable them and their associated propagation work. - You can override the global setting on an individual `` or `` by setting its `notify-dom-change` boolean attribute. + You can override the global setting for an individual `` or `` by setting its `notify-dom-change` boolean attribute: + + ```js + import {PolymerElement, html} from '@polymer/polymer/polymer-element.js'; + + class SomeElement extends PolymerElement { + static get properties() { + return { + visible: {type: Boolean, value: false}, + }; + } + + static get template() { + return html` + + + + + + `; + } + + _toggle() { + this.visible = !this.visible; + } + + _onDomChange(e) { + console.log("Received 'dom-change' event."); + } + } + + customElements.define('some-element', SomeElement); + ``` **Should I use it?** This setting is generally recommended.