{ "id": "144442", "key": "ALOY-1237", "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": [ { "id": "16692", "name": "Alloy 1.7.0", "archived": false, "released": true, "releaseDate": "2015-07-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-05-29T10:52:27.000+0000", "created": "2015-02-10T11:57:42.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "events", "views" ], "versions": [ { "id": "16595", "name": "Alloy 1.5.1", "archived": false, "released": true, "releaseDate": "2014-10-01" } ], "issuelinks": [ { "id": "48903", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "150981", "key": "TIDOC-2300", "fields": { "summary": "Alloy: Document new behaviour of $.destroy", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "49008", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "151209", "key": "ALOY-1303", "fields": { "summary": "$.removeListener() should be called by $.destroy()", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2015-09-16T06:30:08.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "Too make it easier for developers to clean up the event listeners they've added via the XML view ({{onClick}} and other attributes), could we make it so that if you add an event listener that way, that it would also be removed in the {{$.destroy()}} method?\r\n\r\nThe developer would still be responsible for calling that method and for removing listeners he added in the controller, but it would align nicely with the current behaviour of the method where it also cleans up a listener added via the view, which is for the {{}} or {{ tag.\r\n\r\nFor reference:\r\nhttps://github.com/appcelerator/alloy/blob/master/test/apps/basics/markup_events/_generated/ios/alloy/controllers/index.js#L44-L49\r\n\r\nPerhaps the {{__defers}} object could be used for this in some way?\r\n\r\nWe could even go as far as extending the Backbone {{$.listenTo()}} method that if its first argument is a proxy, then it would both pass it on to that proxies' {{addEventListener}} method and queue it for removal in {{$.destroy}} at the same time.", "attachment": [], "flagged": false, "summary": "Alloy: Remove all event listeners added via view in $.destroy()", "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": "Alloy 1.5.1", "closedSprints": [ { "id": 415, "state": "closed", "name": "2015 Sprint 11 Tooling", "startDate": "2015-05-23T02:31:08.429Z", "endDate": "2015-06-06T02:31:00.000Z", "completeDate": "2015-06-08T15:25:54.837Z", "originBoardId": 121 } ], "comment": { "comments": [ { "id": "353879", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR merged.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-05-29T10:52:27.000+0000", "updated": "2015-05-29T10:52:27.000+0000" }, { "id": "362271", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "I have installed Alloy 1.7.6\r\nMarkup of My View:\r\n{code:xml}\r\n\r\n\t\r\n\r\n{code}\r\n\r\nAfter compile I found empty destroy method body:\r\n\r\n{code:javascript}\r\nexports.destroy = function() {};\r\n{code}\r\n\r\nIs it should contains unsubscribe code?\r\n\r\n\r\n\r\n\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Alloy.Controller-method-destroy", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2015-09-04T07:56:45.000+0000", "updated": "2015-09-04T07:56:45.000+0000" }, { "id": "362288", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~falko] it looks like you're right. The {{$.destroy()}} functions should call {{$.removeListener()}}.\r\n\r\n[~k0sukey] see https://github.com/appcelerator/alloy/pull/671#issuecomment-137712880", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-09-04T11:31:14.000+0000", "updated": "2015-09-04T11:35:02.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }