Avoid use of global variables or events if possible.
- There are some uses of global variables, but only recommended if
these variables should persist for the lifetime of the app. These are
found in app/controllers/appIndex.js, app/controllers/index.js, and
app/alloy.js. All global models are created in app/alloy.js and under
Alloy.Models.
- Commerce Cloud Endless Aisle no longer uses Ti.App.fireEvent, but uses
Alloy.eventDispatcher. You should add trigger on controller or model,
but if you need to use a global event, you can use
Alloy.eventDispatcher.