{ "id": "149542", "key": "ALOY-1290", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2015-07-08T18:56:15.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "events" ], "versions": [], "issuelinks": [], "assignee": { "name": "batman", "key": "batman", "displayName": "Bruce Wayne", "active": true, "timeZone": "America/New_York" }, "updated": "2015-07-08T18:56:15.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "I once wrote an article on tiDev titled _The case against Ti.App.fireEvent_:\r\nhttp://www.tidev.io/2014/09/10/the-case-against-ti-app-fireevent-2/\r\n\r\nIn short: using {{Ti.App.fireEvent}} is bad because your listening to these events in JavaScript elsewhere so there's no need to cross the bridge, in particular with big payloads.\r\n\r\nThe alternative in Alloy is to simply use Backbone.Events to create a JS-only dispatcher. This as easy has:\r\n\r\n{code:javascript}\r\nAlloy.Events = _.extend({}, Backbone.Events);\r\n\r\nAlloy.Events.on('myEvent', fn);\r\nAlloy.Events.trigger('myEvent');\r\n{code}\r\n\r\nSince it is this easy.. why not add this to the Alloy library as another global object next to {{Alloy.CFG}} and {{Alloy.Globals}}.", "attachment": [], "flagged": false, "summary": "Provide a global event dispatcher as alternative for Ti.App.fireEvent", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }