Comment on Andro.jsparentComments−brunoc14yStrings can work fine for event names, I think op is overstating the string hell factor. But say you wanted to eliminate them you could do something like: var firstTouchBehaviour = { touchCount: 0, events: { firstTouch: 'FirstTouch' }, setup: function(owner) { andro.eventer(owner).bind(this, "touch", function(contact) { if(contact === "added") { if(this.touchCount === 0) { andro.eventer(owner).emit(this.events.firstTouch); } this.touchCount++; } else if(contact === "removed") { this.touchCount--; } }); } }; and var soundBehaviour = { setup: function(owner) { andro.eventer(owner).bind(this, firstTouchBehaviour.events.firstTouch , function() { console.log("Rarrrrrwwwwwwwwwwwwwwww"); }); } };−maryrosecookOP14yYes, I agree.
Comments
Strings can work fine for event names, I think op is overstating the string hell factor. But say you wanted to eliminate them you could do something like:
andYes, I agree.