{ "id": "105704", "key": "ALOY-403", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14633", "description": "Alloy 0.3.3", "name": "Alloy 0.3.3", "archived": false, "released": true, "releaseDate": "2012-11-30" }, { "id": "14772", "description": "2012 Sprint 24", "name": "2012 Sprint 24", "archived": true, "released": true, "releaseDate": "2012-12-03" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-11-29T23:20:43.000+0000", "created": "2012-11-29T22:31:11.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:26:09.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": "Right now the generated code for making sure we have an instance of a singleton Collection (or Model) looks like this:\r\n\r\n{code:javascript}\r\nAlloy.Collections.todo || (Alloy.Collections.todo = Alloy.createCollection(\"todo\"));\r\n{code}\r\n\r\nIt would be nicer to have a function that returns an instance if we need one, or the already created instance if it exists. Basically, the line of code above shouldn't be generated every single time a or is used in markup. This will help reduce the size of the code, and make it more readable.\r\n\r\n{code:javascript}\r\nAlloy.Collections.instance('todo');\r\nAlloy.Models.instance('todo');\r\n{code}", "attachment": [], "flagged": false, "summary": "Create Alloy.Collections.instance() and Alloy.Models.instance() functions", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }