{"action":"opened","issue":{"url":"https://api.github.com/repos/DimitriMikadze/express-react-redux-starter/issues/3","repository_url":"https://api.github.com/repos/DimitriMikadze/express-react-redux-starter","labels_url":"https://api.github.com/repos/DimitriMikadze/express-react-redux-starter/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/DimitriMikadze/express-react-redux-starter/issues/3/comments","events_url":"https://api.github.com/repos/DimitriMikadze/express-react-redux-starter/issues/3/events","html_url":"https://github.com/DimitriMikadze/express-react-redux-starter/issues/3","id":165431054,"number":3,"title":"Add Object Spread from ES7","user":{"login":"jhabdas","id":440298,"avatar_url":"https://avatars.githubusercontent.com/u/440298?v=3","gravatar_id":"","url":"https://api.github.com/users/jhabdas","html_url":"https://github.com/jhabdas","followers_url":"https://api.github.com/users/jhabdas/followers","following_url":"https://api.github.com/users/jhabdas/following{/other_user}","gists_url":"https://api.github.com/users/jhabdas/gists{/gist_id}","starred_url":"https://api.github.com/users/jhabdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhabdas/subscriptions","organizations_url":"https://api.github.com/users/jhabdas/orgs","repos_url":"https://api.github.com/users/jhabdas/repos","events_url":"https://api.github.com/users/jhabdas/events{/privacy}","received_events_url":"https://api.github.com/users/jhabdas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-13T21:57:20Z","updated_at":"2016-07-13T21:57:20Z","closed_at":null,"body":"While working with Redux I've found it tremendously helpful to use the spread operator `...` in my reducers as shown by Dan Abramov in [Getting Started with Redux](https://egghead.io/courses/getting-started-with-redux). Adding it allows one to do the following:\r\n\r\n```js\r\nreturn {\r\n  ...state,\r\n  currentTime: action.time,\r\n}\r\n```\r\n\r\nInstead of:\r\n\r\n```js\r\nreturn Object.assign({}, state, {\r\n  currentTime: action.time,\r\n});\r\n```\r\n\r\nIf you'd like to add to this kit just `npm i -D transform-es2015-destructuring transform-object-rest-spread eslint-plugin-prefer-object-spread` and update the Babel config as such:\r\n\r\n```\r\n{\r\n  \"presets\": [\"react\", \"es2015\", \"stage-1\"],\r\n  \"plugins\": [\r\n    \"transform-es2015-destructuring\",\r\n    \"transform-object-rest-spread\"\r\n  ]\r\n}\r\n```\r\n\r\nAnd change your ESLint config file to:\r\n\r\n```json\r\n{\r\n  \"extends\": \"airbnb\",\r\n  \"parserOptions\": {\r\n    \"ecmaVersion\": 6,\r\n    \"ecmaFeatures\": {\r\n      \"experimentalObjectRestSpread\": true\r\n    }\r\n  },\r\n  \"plugins\": [\r\n    \"prefer-object-spread\"\r\n  ],\r\n  \"rules\": {\r\n    \"prefer-object-spread/prefer-object-spread\": \"error\"\r\n  },\r\n}\r\n```"}}
{"actor":{"display_login":"jhabdas"}}