mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Standardize: TO JSCS!
This commit is contained in:
13
js/socket.js
13
js/socket.js
@@ -11,22 +11,21 @@ var MMSocket = function(moduleName) {
|
||||
|
||||
var self = this;
|
||||
|
||||
if (typeof moduleName !== 'string') {
|
||||
throw new Error('Please set the module name for the MMSocket.');
|
||||
if (typeof moduleName !== "string") {
|
||||
throw new Error("Please set the module name for the MMSocket.");
|
||||
}
|
||||
|
||||
self.moduleName = moduleName;
|
||||
|
||||
|
||||
self.socket = io('http://localhost:8080');
|
||||
self.socket.on('notification', function (data) {
|
||||
self.socket = io("http://localhost:8080");
|
||||
self.socket.on("notification", function(data) {
|
||||
MM.sendNotification(data.notification, data.payload, Socket);
|
||||
});
|
||||
|
||||
return {
|
||||
sendMessage: function(notification, payload, sender) {
|
||||
Log.log('Send socket message: ' + notification);
|
||||
self.socket.emit('notification', {
|
||||
Log.log("Send socket message: " + notification);
|
||||
self.socket.emit("notification", {
|
||||
notification: notification,
|
||||
sender: sender,
|
||||
payload: payload
|
||||
|
Reference in New Issue
Block a user