@raywo
It returns an array of Javascript objects.
Thanks! That is certainly important to know! :) But I don’t see how that help me here… :(
As for the rest of the test code above, it’s probably not very helpful in my case, but it could be great for another module though. In my code I already have (according to console.log the right output to be fed.) But somehow my feed mechanism is not working and I’m not able to check it.
For example, another dummy question:
Why doesn’t the following console.log’s print anything?
// This comes from YOUR module, usually "node_helper.js"
socketNotificationReceived: function(notification, payload) {
console.log("=====> " + this.name + " received a socket notification: " + notification); //+ " - Payload: " + payload);
switch (notification) {
case "NEW_DATA":
console.log("-----> FlightsAbove: NEW_DATA received!"); // Why doesn't this show?
let ping = payload;
console.log("-- PING!\n");
console.log(ping);
//console.log("-- PING DATA:\n", ping);
this.loaded = true;
this.setTableData(payload);
break;
default:
console.log("Did not match the Notification: ", notification);
}
},
Similarly, here in node_helper.js. Everything before the //WTF comments prints, but the rest is never seen! ???
radarPing: function() {
console.log("ENTER (inside)");
Promise.all([
//radar(-8.20917,114.62177,-9.28715,115.71243) // "PDS" (Bali Airport)
radar(53.05959,12.52388,51.98161,14.29552) // (Berlin)
]).then(function(results) {
var ping = JSON.stringify(results);
console.log("Sending NEW_DATA:");
console.log(ping);
// WTF! This below is never shown!
this.sendSocketNotification("NEW_DATA", ping); //self?
console.log("Sent NEW_DATA!");
console.log("NEW_DATA is: %O", ping);
console.dir(ping, {depth: null, colors: true});
//return ping;
}).then(function(error) {
//console.log("ERROR:")
console.log(error);
});
console.log("EXIT (inside)");
},
So at the end of the day, I have no idea if the NEW_DATA socket notification was actually sent, nor what was the payload, nor if it was received.