E.on('init'...) #5475
Replies: 1 comment
-
Posted at 2016-11-08 by @gfwilliams Actually changing the function after you set it is difficult - you'd have to remove and re-add it. However if you do something like this:
Then each time you redefine That works for all kinds of things, but if you have an anonymous function it makes life much more difficult! Posted at 2016-11-08 by .Neil Thanks Gordon. Posted at 2016-11-09 by @gfwilliams No problem - looks like you sorted your forum name out too? :) Posted at 2016-11-09 by .Neil Yes, someone had preemptively stolen my name but no error message appeared telling me so. So it appears onInit() is the simpler choice for startup routines and E.on('init'...) is for more esoteric needs. Posted at 2016-11-09 by @gfwilliams Yes, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-11-08 by .Neil
Hi all-
I'm new user to the forum and Espruino.
I couldn't find a way to edit code created for E.on('init'). Is there a way to do this?
Or do I have to erase the entire handler with E.removeAllListeners('init')?
Or use reset() ?
Thanks for your help.
-Neil
(oh also couldn't find a way to change my username from the memorable "user70118." Wouldn't preserve my changes after hitting Save.)
Beta Was this translation helpful? Give feedback.
All reactions