MagicMirrorOrg / MagicMirror

MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant.
http://magicmirror.builders
MIT License
19.33k stars 4.15k forks source link

add wrapper ClassName // DOM_CONTENT_UPDATED #3425

Closed bugsounet closed 1 month ago

bugsounet commented 1 month ago

Added:

Idea: Add a callback option in updateDom()

  if (typeof updateOptions?.options?.callback === "function") {
    updateOptions.options.callback();
    //module.notificationReceived("DOM_CONTENT_UPDATED",null,null))
  }

can be used with:

this.updateDom({options: { speed: 2, callback: () => this.checkInactive()}});
sdetweil commented 1 month ago

jeez that sounds like a lot of waste.. notifications on every dom update.. WHY? what is the use case?

If YOU need to know put a change event on the node

sdetweil commented 1 month ago

see the Observer and Mutation events https://stackoverflow.com/questions/3219758/detect-changes-in-the-dom

bugsounet commented 1 month ago

really ? ... and with njk ?

bugsounet commented 1 month ago

Closed: not need because #3426 is close