A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
Catching the DOM content is updated
-
Is there any good practice for catching the moment
updateDom()
finishing? Or the moment of contents that are created bygetDom()
are rendered on the screen?
I have to do some job after rendering, but hard to measure or guarantee when it finishes.... this.updateDom(options) this.doSomethingWithRenderedDom() ...
- The module
this
itself is not the only module that can call.updateDom()
.updateDom()
is not promise-able or doesn’t have a callback function to notify rendering finished..getDom()
is promise-able, but not consumable by the module itself.- in
.getDom()
, the contents are not rendered yet, so I cannot do certain job at that moment. - The only way I can do is using
MutationObserver
, but that is not convenient.
What I need might be
module.domUpdated()
. orawait module.updateDom()
ormodule.updateDom(options, callback)
. orDOM_UPDATED
notification.Or… Is there any better way to achieve this?
- The module