{"action":"opened","issue":{"url":"https://api.github.com/repos/mozilla/addons-frontend/issues/3421","repository_url":"https://api.github.com/repos/mozilla/addons-frontend","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/3421/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/3421/comments","events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/3421/events","html_url":"https://github.com/mozilla/addons-frontend/issues/3421","id":264044888,"number":3421,"title":"Don't store addons in top-level of addons reducer","user":{"login":"tofumatt","id":90871,"avatar_url":"https://avatars2.githubusercontent.com/u/90871?v=4","gravatar_id":"","url":"https://api.github.com/users/tofumatt","html_url":"https://github.com/tofumatt","followers_url":"https://api.github.com/users/tofumatt/followers","following_url":"https://api.github.com/users/tofumatt/following{/other_user}","gists_url":"https://api.github.com/users/tofumatt/gists{/gist_id}","starred_url":"https://api.github.com/users/tofumatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofumatt/subscriptions","organizations_url":"https://api.github.com/users/tofumatt/orgs","repos_url":"https://api.github.com/users/tofumatt/repos","events_url":"https://api.github.com/users/tofumatt/events{/privacy}","received_events_url":"https://api.github.com/users/tofumatt/received_events","type":"User","site_admin":false},"labels":[{"id":357492876,"url":"https://api.github.com/repos/mozilla/addons-frontend/labels/component:%20code%20quality","name":"component: code quality","color":"107c05","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-09T22:29:37Z","updated_at":"2017-10-09T22:29:37Z","closed_at":null,"author_association":"MEMBER","body":"Right now we store addons in the top of the addons reducer rather than organzing them in a dictionary under a key of the main reducer state object. Right now we have:\r\n\r\n```js\r\nconsole.log(state);\r\n{\r\n  addonsReducer: {\r\n    addonSlug: { [...addon] },\r\n    anotherAddonSlug: { [...addon] },\r\n  },\r\n  [...]\r\n}\r\n```\r\n\r\nBut this prevents us from storing any other info in this reducer, like languagePack slugs as we wanted to in https://github.com/mozilla/addons-frontend/pull/3289#discussion_r143288040\r\n\r\nWe want:\r\n\r\n```js\r\nconsole.log(state);\r\n{\r\n  addonsReducer: {\r\n    bySlug: {\r\n      addonSlug: { [...addon] },\r\n      anotherAddonSlug: { [...addon] },\r\n    },\r\n    otherReducerData,\r\n  },\r\n  [...]\r\n}\r\n```"}}
{"actor":{"display_login":"tofumatt"}}