Since the CLOUD variables are much easier to use than the Firebase GET and SAVE block, I wanted to see if the WHEN…INITILIZES OR CHANGES block could be used in place of the Firebase listener. I built an little app to track the screen START, screen OPEN, and WHEN…INITILIZES OR CHANGES for a CLOUD, STORED, and APP variable.
The cloud variable WHEN…INITILIZES OR CHANGES occurs on start up and when the variable changes (as I would hope). The STORED and APP variable WHEN…INITILIZES OR CHANGES occur not only when they change, but every time a screen opens. I’ve uploaded a screen capture in the zip file demonstrating the the out of my simple app Thunkable
First Time Load
Second Time Load (after switching to another screen)
Notice that the Screen start event occurs every time the screen opens, not just the first time.
Additionally, the cloud variable change event only occurs when the app is first started, but the APP and STORED variable change events occur every time the screen opens. So in a multi screen app, the variable change event occurs every time there is a switch from one screen to the next
If I add a Top Tab to encapsulate my 2 screens, the behavior changes again. Now the STORED and APP INITILIZES OR CHANGES occur when the screen first loads, and then only when the variables change.The cloud INITILIZES OR CHANGES events occur on both screen when the cloud variable is changed. Interestingly, it occurs twice on the starting screen.(EDIT: Apparently the screen becase corrupted and has some sort of phantom event that I cannot delete causing the second change event) The start events do not occur when switching between screens.
here is a link to the long video of the top tab version demonstration.
At the end of the day, it would be nice to have some sort of list or chart showing when these asynchronous events occur so we can manage our apps accordingly.
Thanks and Happy Thunking