You are reading a single comment by @Kolban and its replies. Click here to read the full conversation.
  • I read the docs on E.on('init') here http://www.espruino.com/Reference#l_E_in­it and I'm not getting "it". If I write a JavaScript, surely the script runs at line 1 onwards and hence if I wanted initialization functions, I would explicitly execute them from my script?

    Now, if I was to "guess" what is going on, what we are saying here is that E.on('init') causes functions to be registered which are saved in the "state" when a JavaScript program is saved to flash and are run when it is load from flash? Is that close to being correct?

    If so, I think we need a page of documentation (if it doesn't already exist) that describes the philosophy of save and load of programs and the state that is maintained. This would then want to be referenced in the docs for E.on('init').

About

Avatar for Kolban @Kolban started