Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docs for new notification MODULE_DOM_UPDATED #262

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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