MCPcopy
hub / github.com/MagicMirrorOrg/MagicMirror / sendNotification

Function sendNotification

js/main.js:632–650  ·  view source on GitHub ↗

* Send a notification to all modules. * @param {string} notification The identifier of the notification. * @param {object} payload The payload of the notification. * @param {Module} sender The module that sent the notification.

(notification, payload, sender)

Source from the content-addressed store, hash-verified

630 * @param {Module} sender The module that sent the notification.
631 */
632 sendNotification (notification, payload, sender) {
633 if (arguments.length < 3) {
634 Log.error("sendNotification: Missing arguments.");
635 return;
636 }
637
638 if (typeof notification !== "string") {
639 Log.error("sendNotification: Notification should be a string.");
640 return;
641 }
642
643 if (!(sender instanceof Module)) {
644 Log.error("sendNotification: Sender should be a module.");
645 return;
646 }
647
648 // Further implementation is done in the private method.
649 _sendNotification(notification, payload, sender);
650 },
651
652 /**
653 * Update the dom for a specific module.

Callers

nothing calls this directly

Calls 1

_sendNotificationFunction · 0.85

Tested by

no test coverage detected