I guess maybe I'd have had a setUI per screen that had touch buttons, and put a separate touch handler in there (so the touch handler went with the screen that you were on), but that's just personal preference. Your way of doing it with the one touch handler that does everything based on what screen you're on is totally fine.
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.
Great! Yes, as far as I can see that looks good!
I guess maybe I'd have had a
setUI
per screen that had touch buttons, and put a separate touch handler in there (so the touch handler went with the screen that you were on), but that's just personal preference. Your way of doing it with the one touch handler that does everything based on what screen you're on is totally fine.