What I did not cover there is what has to be done to make sure that after reset / power cycle 'ALL things are there to resume normal operation'. For my stuff I use sequencer and initializer that makes that happen.
Decent SW design tries to separate concerns. Even though all things can abstractly be looked at as resources and treated equally - also sequence / time wise - they are not equal, and on top of it they have (inter)dependencies of existence and sequence / time. As if this is not enough complex yet, asynchronousity is added to the . Promises save you from callback hell, but they are not simple heaven either... ;-)
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.
@MarcoM, taking a look at ...explanation what save () does may help you to sort things out.
What I did not cover there is what has to be done to make sure that after reset / power cycle 'ALL things are there to resume normal operation'. For my stuff I use sequencer and initializer that makes that happen.
Decent SW design tries to separate concerns. Even though all things can abstractly be looked at as resources and treated equally - also sequence / time wise - they are not equal, and on top of it they have (inter)dependencies of existence and sequence / time. As if this is not enough complex yet, asynchronousity is added to the . Promises save you from callback hell, but they are not simple heaven either... ;-)