{"action":"created","comment":{"url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments/72917597","id":72917597,"diff_hunk":"@@ -1,47 +1,121 @@\n import Ember from 'ember';\n \n-export default Ember.Component.extend({\n+const {\n+  Component,\n+  computed,\n+  get,\n+  inject: {\n+    service,\n+  },\n+  set,\n+} = Ember;\n+\n+\n+/**\n+ * `category-item` composes a category's icon, and description.\n+ *\n+ * ## default usage\n+ *\n+ * ```handlebars\n+ * {{category-item category=category}}\n+ * ```\n+ *\n+ * @class category-item\n+ * @module Component\n+ * @extends Ember.Component\n+ */\n+export default Component.extend({\n   classNames: ['category-item'],\n   classNameBindings: ['selected'],\n   isLoading: false,\n \n-  flashMessages: Ember.inject.service(),\n-  userCategories: Ember.inject.service(),\n+  /**\n+   * @property flashMessages\n+   * @type Ember.Service\n+   */\n+  flashMessages: service(),\n+\n+  /**\n+   * @property userCategories\n+   * @type Ember.Service\n+   */\n+  userCategories: service(),\n \n-  selected: Ember.computed.notEmpty('userCategory'),\n+  /**\n+   * Returns if the category has been selected by the user.\n+   *\n+   * @property selected\n+   * @type Boolean\n+   */\n+  selected: computed.notEmpty('userCategory'),\n+\n+  /**\n+   * Fetches the category using the `userCategories` service.\n+   *\n+   * @property userCategory\n+   * @type {Object} category\n+   */\n+  userCategory: computed('category', 'userCategories.userCategories', function() {\n+    const category = get(this, 'category');\n+    const userCategories = get(this, 'userCategories');\n \n-  userCategory: Ember.computed('category', 'userCategories.userCategories', function() {\n-    let category = this.get('category');\n-    let userCategories = this.get('userCategories');\n     return userCategories.findUserCategory(category);\n   }),\n \n   actions: {\n+\n+    /**\n+     * Action that sets the `isLoading` property to `true` and saves the\n+     * category to the user's categories. If there is an error saving the\n+     * category, a flash message is displayed. The `isLoading` property is\n+     * reset after the save passes/fails.\n+     *\n+     * @method addCategory\n+     * @param {Object} category\n+     */\n     addCategory(category) {\n-      this.set('isLoading', true);\n-      let userCategories = this.get('userCategories');\n+      set(this, 'isLoading', true);\n+      const userCategories = get(this, 'userCategories');\n+\n       return userCategories.addCategory(category).catch(() => {\n-        let message = `An error occurred trying to add ${category.get('name')}.`;\n+        const message = `An error occurred trying to add ${category.get('name')}.`;","path":"app/components/category-item.js","position":91,"original_position":91,"commit_id":"430198c5b01c4113a52c543b3cae347a9aeb42bb","original_commit_id":"430198c5b01c4113a52c543b3cae347a9aeb42bb","user":{"login":"thomascchen","id":11340361,"avatar_url":"https://avatars.githubusercontent.com/u/11340361?v=3","gravatar_id":"","url":"https://api.github.com/users/thomascchen","html_url":"https://github.com/thomascchen","followers_url":"https://api.github.com/users/thomascchen/followers","following_url":"https://api.github.com/users/thomascchen/following{/other_user}","gists_url":"https://api.github.com/users/thomascchen/gists{/gist_id}","starred_url":"https://api.github.com/users/thomascchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomascchen/subscriptions","organizations_url":"https://api.github.com/users/thomascchen/orgs","repos_url":"https://api.github.com/users/thomascchen/repos","events_url":"https://api.github.com/users/thomascchen/events{/privacy}","received_events_url":"https://api.github.com/users/thomascchen/received_events","type":"User","site_admin":false},"body":"From their style guide: https://github.com/dockyard/styleguides/blob/master/engineering/javascript.md#assignment\r\n\r\n```\r\nNever use var. Prefer let to declare a block scope local variable; use const to declare a constant whose value can not be re-assigned in the given scope (global or local).\r\n```\r\n\r\nNot super explicit, but I think I would interpret that as defaulting to `let` and then using `const` only when there is a variable that we specifically want to guard against reassignment.","created_at":"2016-08-01T02:16:38Z","updated_at":"2016-08-01T02:16:38Z","html_url":"https://github.com/code-corps/code-corps-ember/pull/343#discussion_r72917597","pull_request_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343","_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments/72917597"},"html":{"href":"https://github.com/code-corps/code-corps-ember/pull/343#discussion_r72917597"},"pull_request":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343"}}},"pull_request":{"url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343","id":78794589,"html_url":"https://github.com/code-corps/code-corps-ember/pull/343","diff_url":"https://github.com/code-corps/code-corps-ember/pull/343.diff","patch_url":"https://github.com/code-corps/code-corps-ember/pull/343.patch","issue_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/343","number":343,"state":"open","locked":false,"title":"add category-item documentation","user":{"login":"WenInCode","id":5448834,"avatar_url":"https://avatars.githubusercontent.com/u/5448834?v=3","gravatar_id":"","url":"https://api.github.com/users/WenInCode","html_url":"https://github.com/WenInCode","followers_url":"https://api.github.com/users/WenInCode/followers","following_url":"https://api.github.com/users/WenInCode/following{/other_user}","gists_url":"https://api.github.com/users/WenInCode/gists{/gist_id}","starred_url":"https://api.github.com/users/WenInCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WenInCode/subscriptions","organizations_url":"https://api.github.com/users/WenInCode/orgs","repos_url":"https://api.github.com/users/WenInCode/repos","events_url":"https://api.github.com/users/WenInCode/events{/privacy}","received_events_url":"https://api.github.com/users/WenInCode/received_events","type":"User","site_admin":false},"body":"# What's in this PR?\r\n- Adds documentation for the `category-item` component\r\n- Minor refactors\r\n\r\n## References\r\nIssue: #223 ","created_at":"2016-07-26T05:45:07Z","updated_at":"2016-08-01T02:16:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e94c8311a22ff0331b469f4c6341b111935a1ca0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343/commits","review_comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343/comments","review_comment_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/343/comments","statuses_url":"https://api.github.com/repos/code-corps/code-corps-ember/statuses/430198c5b01c4113a52c543b3cae347a9aeb42bb","head":{"label":"WenInCode:add-category-item-docs","ref":"add-category-item-docs","sha":"430198c5b01c4113a52c543b3cae347a9aeb42bb","user":{"login":"WenInCode","id":5448834,"avatar_url":"https://avatars.githubusercontent.com/u/5448834?v=3","gravatar_id":"","url":"https://api.github.com/users/WenInCode","html_url":"https://github.com/WenInCode","followers_url":"https://api.github.com/users/WenInCode/followers","following_url":"https://api.github.com/users/WenInCode/following{/other_user}","gists_url":"https://api.github.com/users/WenInCode/gists{/gist_id}","starred_url":"https://api.github.com/users/WenInCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WenInCode/subscriptions","organizations_url":"https://api.github.com/users/WenInCode/orgs","repos_url":"https://api.github.com/users/WenInCode/repos","events_url":"https://api.github.com/users/WenInCode/events{/privacy}","received_events_url":"https://api.github.com/users/WenInCode/received_events","type":"User","site_admin":false},"repo":{"id":62817933,"name":"code-corps-ember","full_name":"WenInCode/code-corps-ember","owner":{"login":"WenInCode","id":5448834,"avatar_url":"https://avatars.githubusercontent.com/u/5448834?v=3","gravatar_id":"","url":"https://api.github.com/users/WenInCode","html_url":"https://github.com/WenInCode","followers_url":"https://api.github.com/users/WenInCode/followers","following_url":"https://api.github.com/users/WenInCode/following{/other_user}","gists_url":"https://api.github.com/users/WenInCode/gists{/gist_id}","starred_url":"https://api.github.com/users/WenInCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WenInCode/subscriptions","organizations_url":"https://api.github.com/users/WenInCode/orgs","repos_url":"https://api.github.com/users/WenInCode/repos","events_url":"https://api.github.com/users/WenInCode/events{/privacy}","received_events_url":"https://api.github.com/users/WenInCode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WenInCode/code-corps-ember","description":"Ember front-end for Code Corps.","fork":true,"url":"https://api.github.com/repos/WenInCode/code-corps-ember","forks_url":"https://api.github.com/repos/WenInCode/code-corps-ember/forks","keys_url":"https://api.github.com/repos/WenInCode/code-corps-ember/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WenInCode/code-corps-ember/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WenInCode/code-corps-ember/teams","hooks_url":"https://api.github.com/repos/WenInCode/code-corps-ember/hooks","issue_events_url":"https://api.github.com/repos/WenInCode/code-corps-ember/issues/events{/number}","events_url":"https://api.github.com/repos/WenInCode/code-corps-ember/events","assignees_url":"https://api.github.com/repos/WenInCode/code-corps-ember/assignees{/user}","branches_url":"https://api.github.com/repos/WenInCode/code-corps-ember/branches{/branch}","tags_url":"https://api.github.com/repos/WenInCode/code-corps-ember/tags","blobs_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/refs{/sha}","trees_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WenInCode/code-corps-ember/statuses/{sha}","languages_url":"https://api.github.com/repos/WenInCode/code-corps-ember/languages","stargazers_url":"https://api.github.com/repos/WenInCode/code-corps-ember/stargazers","contributors_url":"https://api.github.com/repos/WenInCode/code-corps-ember/contributors","subscribers_url":"https://api.github.com/repos/WenInCode/code-corps-ember/subscribers","subscription_url":"https://api.github.com/repos/WenInCode/code-corps-ember/subscription","commits_url":"https://api.github.com/repos/WenInCode/code-corps-ember/commits{/sha}","git_commits_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/commits{/sha}","comments_url":"https://api.github.com/repos/WenInCode/code-corps-ember/comments{/number}","issue_comment_url":"https://api.github.com/repos/WenInCode/code-corps-ember/issues/comments{/number}","contents_url":"https://api.github.com/repos/WenInCode/code-corps-ember/contents/{+path}","compare_url":"https://api.github.com/repos/WenInCode/code-corps-ember/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WenInCode/code-corps-ember/merges","archive_url":"https://api.github.com/repos/WenInCode/code-corps-ember/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WenInCode/code-corps-ember/downloads","issues_url":"https://api.github.com/repos/WenInCode/code-corps-ember/issues{/number}","pulls_url":"https://api.github.com/repos/WenInCode/code-corps-ember/pulls{/number}","milestones_url":"https://api.github.com/repos/WenInCode/code-corps-ember/milestones{/number}","notifications_url":"https://api.github.com/repos/WenInCode/code-corps-ember/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WenInCode/code-corps-ember/labels{/name}","releases_url":"https://api.github.com/repos/WenInCode/code-corps-ember/releases{/id}","deployments_url":"https://api.github.com/repos/WenInCode/code-corps-ember/deployments","created_at":"2016-07-07T15:30:55Z","updated_at":"2016-07-07T15:30:58Z","pushed_at":"2016-07-31T17:09:29Z","git_url":"git://github.com/WenInCode/code-corps-ember.git","ssh_url":"git@github.com:WenInCode/code-corps-ember.git","clone_url":"https://github.com/WenInCode/code-corps-ember.git","svn_url":"https://github.com/WenInCode/code-corps-ember","homepage":"https://codecorps.org","size":1935,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"code-corps:develop","ref":"develop","sha":"14721bd98d205bb7096868cf95a6518acba0346f","user":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":37887675,"name":"code-corps-ember","full_name":"code-corps/code-corps-ember","owner":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-corps/code-corps-ember","description":"Ember front-end for Code Corps.","fork":false,"url":"https://api.github.com/repos/code-corps/code-corps-ember","forks_url":"https://api.github.com/repos/code-corps/code-corps-ember/forks","keys_url":"https://api.github.com/repos/code-corps/code-corps-ember/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/code-corps-ember/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/code-corps-ember/teams","hooks_url":"https://api.github.com/repos/code-corps/code-corps-ember/hooks","issue_events_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/code-corps-ember/events","assignees_url":"https://api.github.com/repos/code-corps/code-corps-ember/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/code-corps-ember/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/code-corps-ember/tags","blobs_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/code-corps-ember/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/code-corps-ember/languages","stargazers_url":"https://api.github.com/repos/code-corps/code-corps-ember/stargazers","contributors_url":"https://api.github.com/repos/code-corps/code-corps-ember/contributors","subscribers_url":"https://api.github.com/repos/code-corps/code-corps-ember/subscribers","subscription_url":"https://api.github.com/repos/code-corps/code-corps-ember/subscription","commits_url":"https://api.github.com/repos/code-corps/code-corps-ember/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/code-corps-ember/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/code-corps-ember/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/code-corps-ember/merges","archive_url":"https://api.github.com/repos/code-corps/code-corps-ember/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/code-corps-ember/downloads","issues_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/code-corps-ember/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/code-corps-ember/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/code-corps-ember/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/code-corps-ember/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/code-corps-ember/deployments","created_at":"2015-06-23T00:18:45Z","updated_at":"2016-07-29T08:42:38Z","pushed_at":"2016-08-01T01:51:26Z","git_url":"git://github.com/code-corps/code-corps-ember.git","ssh_url":"git@github.com:code-corps/code-corps-ember.git","clone_url":"https://github.com/code-corps/code-corps-ember.git","svn_url":"https://github.com/code-corps/code-corps-ember","homepage":"https://codecorps.org","size":1966,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":79,"forks":15,"open_issues":79,"watchers":18,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343"},"html":{"href":"https://github.com/code-corps/code-corps-ember/pull/343"},"issue":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/issues/343"},"comments":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/statuses/430198c5b01c4113a52c543b3cae347a9aeb42bb"}}}}
{"actor":{"display_login":"thomascchen"}}