MCPcopy Index your code
hub / github.com/MagicMirrorOrg/MagicMirror / socket

Method socket

js/module.js:237–247  ·  view source on GitHub ↗

* Returns a socket object. If it doesn't exist, it's created. * It also registers the notification callback. * @returns {MMSocket} a socket object

()

Source from the content-addressed store, hash-verified

235 * @returns {MMSocket} a socket object
236 */
237 socket () {
238 if (typeof this._socket === "undefined") {
239 this._socket = new MMSocket(this.name);
240 }
241
242 this._socket.setNotificationCallback((notification, payload) => {
243 this.socketNotificationReceived(notification, payload);
244 });
245
246 return this._socket;
247 }
248
249 /**
250 * Retrieve the path to a module file.

Callers 1

Calls 1

Tested by

no test coverage detected