{"action":"created","issue":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/206","labels_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/206/comments","events_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/206/events","html_url":"https://github.com/shakacode/react_on_rails/issues/206","id":126912407,"number":206,"title":"lodash bindAll can be replaced with stage-1 class property","user":{"login":"chrisvfritz","id":2327556,"avatar_url":"https://avatars.githubusercontent.com/u/2327556?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisvfritz","html_url":"https://github.com/chrisvfritz","followers_url":"https://api.github.com/users/chrisvfritz/followers","following_url":"https://api.github.com/users/chrisvfritz/following{/other_user}","gists_url":"https://api.github.com/users/chrisvfritz/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvfritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvfritz/subscriptions","organizations_url":"https://api.github.com/users/chrisvfritz/orgs","repos_url":"https://api.github.com/users/chrisvfritz/repos","events_url":"https://api.github.com/users/chrisvfritz/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvfritz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/shakacode/react_on_rails/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-01-15T16:58:19Z","updated_at":"2016-01-16T21:52:05Z","closed_at":null,"body":"I see this pattern in the constructors of example components:\r\n\r\n``` js\r\n_.bindAll(this, 'myFunction');\r\n```\r\n\r\nPutting aside the fact that _all_ of lodash was being imported when only a single function was needed, I think even that single function is unnecessary, since a class property (`stage-1`) can be used for the same effect:\r\n\r\n``` js\r\nmyFunction = (arg1, arg2) => {\r\n  // ...\r\n};\r\n```\r\n\r\nEven if you decide to later remove the `stage-0` preset from `.babelrc`, I'd personally much prefer the use of ES5's `.bind`, since it'll also do the job.\r\n\r\n``` js\r\nthis.myFunction = this.myFunction.bind(this)\r\n```\r\n\r\nThen Lodash can be completely removed as a dependency."},"comment":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/comments/172260485","html_url":"https://github.com/shakacode/react_on_rails/issues/206#issuecomment-172260485","issue_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/206","id":172260485,"user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"created_at":"2016-01-16T21:52:05Z","updated_at":"2016-01-16T21:52:05Z","body":"```js\r\nimport { bindAll } from 'lodash/bindAll'\r\n```"}}