The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes.
For example, to include a string from an object, the attribute data-monster-replace
can be used.
a further explanation can be found under DOM-based templating implementation.
Changes to attributes are made only when the direct values are changed. If you want to assign changes to other values
as well, you have to insert the attribute data-monster-select-this
. This should be done with care, as it can reduce performance.
You can create an object of this class using the monster namespace new Monster.DOM.Updater()
.
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
new Monster.DOM.Updater()
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/dom/updater.js';
new Updater()
</script>