Titanium JIRA Archive
Alloy (ALOY)

[ALOY-365] create Alloy.globals and reserve for developer use

GitHub Issuen/a
TypeStory
PriorityMedium
StatusResolved
ResolutionFixed
Resolution Date2012-11-12T19:20:07.000+0000
Affected Version/sn/a
Fix Version/sAlloy 0.3.2, 2012 Sprint 23
ComponentsRuntime
Labelsnotable
ReporterTony Lukasavage
AssigneeUnknown
Created2012-11-05T16:16:22.000+0000
Updated2018-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

  1. Tony Lukasavage 2012-11-12

    Completed and currently in "binding" branch of the github repo
  2. Tony Lukasavage 2012-11-14

    This is no in "master" and will be released with 0.3.2

JSON Source