-
• #2
In your module, you haven't exported anything - so the result of including it will be an empty object. Do:
var wifi = require( "Wifi" ); function MoqBase(){}; MoqBase.prototype.ssid; MoqBase.prototype.startPairing = function () {...} exports = MoqBase;
And then you should be off to a better start. However first, I'd make life simple for yourself by trying it all in one file.
-
• #3
Thanks, the exports did the trick!
I tried to follow the Example , but in Espruino IDE it didn't really work.
I tried the following:
module moq_base.js
and then "inherit":
but it resulted in exceptions like
I tried also to define a plain function inside the "base" module and then call it, but it also fails - function not found.
So, are there any examples / tutorials on using JS-inheritance / inlcusion for ESP?
Or, it shouldn't be used and copy & paste is my only true friend?
Thanks!