[TIMOB-26200] TiAPI: Break out Ti.Media constants to separate namespaces/enum groupings
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | TiAPI |
Labels | ti.media |
Reporter | Christopher Williams |
Assignee | Unknown |
Created | 2018-07-10T19:58:41.000+0000 |
Updated | 2018-07-10T19:58:41.000+0000 |
Description
Currently we have a practice of grouping an enumeration of possible constant values on the parent module's namespace with some long identical prefix to denote their relationship.
This is not a great way to organize the constants. While Javascript does not have a native enum type, we could certainly do a better job by namespacing the related values into a "group" by hanging them off an object.
It clutters up the docs/API of the parent module, and leads to super-long ALL_UPPERCASE_SCARY_NAMES_LIKE_THIS.
Something similar to:
- https://www.sohamkamani.com/blog/2017/08/21/enums-in-javascript/
- https://stackoverflow.com/questions/287903/what-is-the-preferred-syntax-for-defining-enums-in-javascript
No comments