@d-healey I seeeee! I'll start doing it like this. I've been using if statements alot because im comfortable but I can see that I may be complicating things in some situations. Thanks Dave.
Why would the value I set for the panel onInit then not be available?
After on init completes the value is overwritten by whatever the last saved value was, since you only ever set the value in on init the last saved value - a value set after on init - will be undefined.
Try it with a slider, set it's value in on init, hit compile and you will see the slider ignores the value you've set.
Does it mean that it cannot save values that are set onInit and that all of the values that it will restore must be entered dynamically through callbacks after onInit?
@d-healey Nope, it's the only namespace in the project and it was just to have some nice prefixes on the constants. It feels like something with variable hoisting but I'll check properly later.