AppsScriptPulse

Apps Script V8: Keystore for global space – Desktop liberation

One of the challenges with V8 compared to Rhino is that you can’t be sure of the order of global variable initialization. Personally this is not an issue for me, as I avoid any such use of global space, but it is an issue for some. A nice way of dealing with global space is to use namespaces and IEF as I described in Apps Script V8: Multiple script files, classes and namespaces but another, perhaps less obvious way, is put all the variables (and even functions) you need to access from multiple functions in a keystore.

Interesting solution for storing/retrieving variables, particularly when you are using the new V8 runtime.

Source: Apps Script V8: Keystore for global space – Desktop liberation

Leave a Reply

Your email address will not be published. Required fields are marked *