{"action":"closed","issue":{"url":"https://api.github.com/repos/krambertech/react-essential-course/issues/8","repository_url":"https://api.github.com/repos/krambertech/react-essential-course","labels_url":"https://api.github.com/repos/krambertech/react-essential-course/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/krambertech/react-essential-course/issues/8/comments","events_url":"https://api.github.com/repos/krambertech/react-essential-course/issues/8/events","html_url":"https://github.com/krambertech/react-essential-course/issues/8","id":159993482,"number":8,"title":"Небольшой вопрос","user":{"login":"h-consul","id":19517211,"avatar_url":"https://avatars.githubusercontent.com/u/19517211?v=3","gravatar_id":"","url":"https://api.github.com/users/h-consul","html_url":"https://github.com/h-consul","followers_url":"https://api.github.com/users/h-consul/followers","following_url":"https://api.github.com/users/h-consul/following{/other_user}","gists_url":"https://api.github.com/users/h-consul/gists{/gist_id}","starred_url":"https://api.github.com/users/h-consul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-consul/subscriptions","organizations_url":"https://api.github.com/users/h-consul/orgs","repos_url":"https://api.github.com/users/h-consul/repos","events_url":"https://api.github.com/users/h-consul/events{/privacy}","received_events_url":"https://api.github.com/users/h-consul/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-13T16:37:35Z","updated_at":"2016-06-17T06:32:43Z","closed_at":"2016-06-17T06:32:43Z","body":"Екатерина, добрый день!\r\nПросмотрел ваш курс по ReactJS, (второй урок).\r\nНикак не могу понять для чего вы использовали \"bind()\" (для удаления заметок). Зачем этот \"bind()\" нужен? Для чего в принципе используют \"bind()\" мне понятно. \r\n\r\nПример:\r\n//===========================================\r\nvar add = function (a, b) {\r\n  return a + b;\r\n};\r\nvar add2 = add.bind(null, 2);\r\n\r\nadd2(10) === 12;\r\n//===========================================\r\n\r\nНо какую роль он играет именно в вашем скрипте, я не могу понять\r\nЕсли найдется свободная минутка, объясните в двух словах, если не сложно.\r\nБлагодарю\r\n\r\nvar NotesGrid = ........\r\n.........\r\nrender: function() {\r\nvar onNoteDelete = this.props.onNoteDelete;\r\nreturn(\r\n\r\n{\r\nthis.props.notes.map(function(note){\r\nreturn(\r\nkey = {note.id}\r\nonDelete = {onNoteDelete.bind(null, note)}                //////////////////////////////////// зачем bind()?\r\ncolor = {note.color}\r\n> {note.text}\r\n);\r\n})\r\n}\r\n\r\n);\r\n}"}}
{"actor":{"display_login":"krambertech"}}