* 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)
| 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. |
nothing calls this directly
no test coverage detected