For those who are wondering, the root state is never changed. Meaning, it can hold data and state. while calling the `SwitchScreen()` method on a screen, the screen itself is initialized. So the data related to the child screen will be reset, but the root screen which is responsible for switching the screens will not be changed and if a variable is defined in the root screen file, it can be used in all the other screens - other screens shall be able to read and write to this particular variable. Here's an example:
typerootScreenModelstruct{ modeltea.Model// this will hold the current screen model }
global_variable:=10;
//... other root screen implementation
In any other screen defined in `screens/` we can just access it:
//...otherfunctions func(mscreenTwoModel)View()string{ str:=fmt.Sprintf("%s This is child screen... and the global variable is: %d",m.spinner.View(),global_variable) returnstr }
Yes. That's correct. I did, in fact, reference Google Chrome's developer tools in the article. In Chrome, you go to the "Applications" tab > Storage section to see the cookies. And yes, this location may vary per browser, but the general idea remains the same, i.e. you are looking for a cookie called `user_uuid`.