You are reading a single comment by @NebbishHacker and its replies. Click here to read the full conversation.
  • You could remove one layer of function nesting by making each face a module.

    Each face would then follow the format

    exports.getFace = function (){
        function onSecond(){
           //draw digits, hands etc
        }
        function drawAll(){
           //draw background + initial state of digits, hands etc
        }
        return {init:drawAll, tick:onSecond};
    };
    

    And to load them you'd do something along the lines of

    let FACES = require("Storage").list(/\.face\.js$/).map(require);
    
About