[ALOY-365] create Alloy.globals and reserve for developer use
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2012-11-12T19:20:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 0.3.2, 2012 Sprint 23 |
Components | Runtime |
Labels | notable |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2012-11-05T16:16:22.000+0000 |
Updated | 2018-03-07T22:25:51.000+0000 |
Description
Alloy.CFG
is a good, safe place to put globals in your Alloy applications so that you don't need to manage a commonjs module for globals yourself. It is also where your config.json configs get stored. It would likely be more intuitive for developers if they hada clear place to store globals. For this reason, I'd like to make the Alloy.globals
namespace an empty object where developers can attach globals that they can then reference throughout the application.
It seems like a little bit of overlap with Alloy.CFG
, but I think Alloy.globals
is far more intuitive and and much more common use case.
alloy.js
// Alloy.globals by default equals {}
Alloy.globals.someGlobalFunction = function(){};
*Important*: Alloy.globals
will erase the need for developers to roll their own globals libraries/namespaces.
Comments
- Tony Lukasavage 2012-11-12 Completed and currently in "binding" branch of the github repo
- Tony Lukasavage 2012-11-14 This is no in "master" and will be released with 0.3.2