@DavidV, I'd like you to be a bit more explanatory about what you intend to convey with your example(s). What is the console output?
On related note, what is your reasoning to use setInterval() rather than setTimeout() in RunOnce()?
On an unrelated note - since JavaScript is object-oriented and related practice is to use Upper/lower case to distinguish Class/Prototype 'things' from method/function/members/properties 'things' - what is the reasoning to use Uppercase identifiers for the functions?
Doing an analysis of what is effectively going on, I see line 34 as the only Promise-worthy item. May be I look at the example(s) way too narrow minded, and you have a grander vision why to use Promises even though no asynchronous things happen (except - as already mentioned - in line 34). To me, it almost feels as: Why simple, if complicated/confusing works too?
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.
@DavidV, I'd like you to be a bit more explanatory about what you intend to convey with your example(s). What is the console output?
On related note, what is your reasoning to use
setInterval()
rather thansetTimeout()
inRunOnce()
?On an unrelated note - since JavaScript is object-oriented and related practice is to use Upper/lower case to distinguish Class/Prototype 'things' from method/function/members/properties 'things' - what is the reasoning to use Uppercase identifiers for the functions?
Doing an analysis of what is effectively going on, I see line 34 as the only Promise-worthy item. May be I look at the example(s) way too narrow minded, and you have a grander vision why to use Promises even though no asynchronous things happen (except - as already mentioned - in line 34). To me, it almost feels as: Why simple, if complicated/confusing works too?