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);
@NebbishHacker started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You could remove one layer of function nesting by making each face a module.
Each face would then follow the format
And to load them you'd do something along the lines of