[TIMOB-17828] Declare constants for event name strings
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.4.0 |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Chris Bowley |
Assignee | Unknown |
Created | 2014-10-08T13:19:20.000+0000 |
Updated | 2018-02-28T20:03:37.000+0000 |
Description
Using strings for event names is prone to typos which cause silent failures. Declaring constants, much like we have for style enumerations, would resolve this problem.
e.g.
$.myButton.addEventListener('cilck', function(e){
// nothing happens but its not obvious why
});
Could be replaced with:
$.myButton.addEventListener(Titanium.UI.Button.CLICK, function(e){
// ...
});
No comments