{"comment":{"url":"https://api.github.com/repos/dellfort/angular2-redux-ag-grid/comments/16168196","html_url":"https://github.com/dellfort/angular2-redux-ag-grid/commit/af8b21b427f52fc53d6b51ea3214444829a8bb6c#commitcomment-16168196","id":16168196,"user":{"login":"dellfort","id":24451,"avatar_url":"https://avatars.githubusercontent.com/u/24451?v=3","gravatar_id":"","url":"https://api.github.com/users/dellfort","html_url":"https://github.com/dellfort","followers_url":"https://api.github.com/users/dellfort/followers","following_url":"https://api.github.com/users/dellfort/following{/other_user}","gists_url":"https://api.github.com/users/dellfort/gists{/gist_id}","starred_url":"https://api.github.com/users/dellfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dellfort/subscriptions","organizations_url":"https://api.github.com/users/dellfort/orgs","repos_url":"https://api.github.com/users/dellfort/repos","events_url":"https://api.github.com/users/dellfort/events{/privacy}","received_events_url":"https://api.github.com/users/dellfort/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"af8b21b427f52fc53d6b51ea3214444829a8bb6c","created_at":"2016-02-18T06:56:35Z","updated_at":"2016-02-18T06:56:35Z","body":"code review:\r\n- use let instead of var. There is no need for the extended scope of var here\r\n- declaration and reassignment of newState before '!state' -check is unnecessary\r\n- long code blocks in conditional statements (like here in 'else') are hard to read\r\n\r\nproposition:\r\n\r\n`if (!state) return initialState;\r\nlet newState;\r\nswitch (action.type) {\r\n...\r\n`\r\n\r\n\r\n"}}