You are reading a single comment by @rigrig and its replies. Click here to read the full conversation.
  • Is there a proper convention for names of objects created by boot code, or am I too paranoid about naming conflicts?

    Well, you could just "search all files" for your variable name, and if it doesn't turn up you should be fine.

    But do you really need a global variable? If possible it's cleaner to wrap stuff in a function scope:

            const origOn = Bangle.on;
            Bangle.on = function(event, listener) {
                  // do stuff
        , event, listener);
  • So that's why I sometimes see (function(){ /* stuff */ })(); being done! That's a far better idea than using global variables with naming conventions. I'm going to use function scopes instead. Obviously with nice clean names because I can get away with them now.


Avatar for rigrig @rigrig started