Skip to content

Commit

Permalink
Added docs for new notification MODULE_DOM_UPDATED (#262)
Browse files Browse the repository at this point in the history
* Bump send and express (#260)

Bumps [send](https://github.com/pillarjs/send) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `send` from 0.18.0 to 0.19.0
- [Release notes](https://github.com/pillarjs/send/releases)
- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md)
- [Commits](pillarjs/send@0.18.0...0.19.0)

Updates `express` from 4.20.0 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](expressjs/express@4.20.0...4.21.0)

---
updated-dependencies:
- dependency-name: send
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Added docs for new notification - . Fixes #261

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
ryan-d-williams and dependabot[bot] authored Sep 19, 2024
1 parent ff262af commit 73fae2b
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 530 deletions.
2 changes: 2 additions & 0 deletions development/core-module-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ Whenever your module need to be updated, call the `updateDom(speed)` method. It
requests the MagicMirror core to update its dom object. If you define the speed,
the content update will be animated, but only if the content will really change.

Note that the rendering of the updated dom on the screen will happen asynchronously. You can listen for the [`DOM_OBJECTS_UPDATED` notification](/development/notifications.html) to know when the rendering is complete and the new dom is safe to interact with. This notification only fires if the content will really change.

As an example: the clock modules calls this method every second:

```javascript
Expand Down
3 changes: 2 additions & 1 deletion development/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ The system sends three notifications when starting up:
| `ALL_MODULES_STARTED` | _none_ | All modules are started. You can now send notifications to other modules. |
| `DOM_OBJECTS_CREATED` | _none_ | All dom objects are created. The system is now ready to perform visual changes. |
| `MODULE_DOM_CREATED` | _none_ | This module's dom has been fully loaded. You can now access your module's dom objects. |
| `MODULE_DOM_UPDATED` | _none_ | This module's dom has been updated and re-rendered. You can now access your module's (updated) dom objects. This notification is sent in response to a call to [`updateDom`](https://docs.magicmirror.builders/development/core-module-file.html#module-instance-methods). |

# Default module notifications

These notifications are send by the default modules:
These notifications are sent by the default modules:

| Notification | Payload | Description |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
104 changes: 32 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 73fae2b

Please sign in to comment.