{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/comments/44369488","id":44369488,"diff_hunk":"@@ -1,23 +1,64 @@\n module.exports = function () {\n+    var subscriptions = [];\n     return {\n         on: function (eventName, student, callback) {\n-\n+            subscriptions.push({\n+                target: student,\n+                event: eventName,\n+                callBack: callback\n+            });\n         },\n-\n         off: function (eventName, student) {\n-\n+            for (var i = subscriptions.length; i >= 0; i--) {\n+                if (subscriptions[i] !== undefined &&\n+                    subscriptions[i].event.indexOf(eventName) !== -1 &&\n+                    subscriptions[i].target === student) {\n+                    subscriptions.splice(i, 1);\n+                }\n+            }\n         },\n-\n         emit: function (eventName) {\n-\n+            var eventFstLvl = eventName.split('.')[0];","path":"emitter.js","position":26,"original_position":26,"commit_id":"1ccfb4af56a3d754ada9fe271e224499497db3da","original_commit_id":"1ccfb4af56a3d754ada9fe271e224499497db3da","user":{"login":"gogoleff","id":4534405,"avatar_url":"https://avatars.githubusercontent.com/u/4534405?v=3","gravatar_id":"","url":"https://api.github.com/users/gogoleff","html_url":"https://github.com/gogoleff","followers_url":"https://api.github.com/users/gogoleff/followers","following_url":"https://api.github.com/users/gogoleff/following{/other_user}","gists_url":"https://api.github.com/users/gogoleff/gists{/gist_id}","starred_url":"https://api.github.com/users/gogoleff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gogoleff/subscriptions","organizations_url":"https://api.github.com/users/gogoleff/orgs","repos_url":"https://api.github.com/users/gogoleff/repos","events_url":"https://api.github.com/users/gogoleff/events{/privacy}","received_events_url":"https://api.github.com/users/gogoleff/received_events","type":"User","site_admin":false},"body":"First\r\n","created_at":"2015-11-10T04:32:20Z","updated_at":"2015-11-10T04:32:20Z","html_url":"https://github.com/urfu-2015/javascript-tasks-5/pull/43#discussion_r44369488","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/comments/44369488"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-5/pull/43#discussion_r44369488"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43","id":49467954,"html_url":"https://github.com/urfu-2015/javascript-tasks-5/pull/43","diff_url":"https://github.com/urfu-2015/javascript-tasks-5/pull/43.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-5/pull/43.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues/43","number":43,"state":"open","locked":false,"title":"Кладов Валерий","user":{"login":"KladovValery","id":14982426,"avatar_url":"https://avatars.githubusercontent.com/u/14982426?v=3","gravatar_id":"","url":"https://api.github.com/users/KladovValery","html_url":"https://github.com/KladovValery","followers_url":"https://api.github.com/users/KladovValery/followers","following_url":"https://api.github.com/users/KladovValery/following{/other_user}","gists_url":"https://api.github.com/users/KladovValery/gists{/gist_id}","starred_url":"https://api.github.com/users/KladovValery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KladovValery/subscriptions","organizations_url":"https://api.github.com/users/KladovValery/orgs","repos_url":"https://api.github.com/users/KladovValery/repos","events_url":"https://api.github.com/users/KladovValery/events{/privacy}","received_events_url":"https://api.github.com/users/KladovValery/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-02T18:35:36Z","updated_at":"2015-11-10T04:32:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e639d4b542fa3598b2f257a29b98631733f06b95","assignee":{"login":"gogoleff","id":4534405,"avatar_url":"https://avatars.githubusercontent.com/u/4534405?v=3","gravatar_id":"","url":"https://api.github.com/users/gogoleff","html_url":"https://github.com/gogoleff","followers_url":"https://api.github.com/users/gogoleff/followers","following_url":"https://api.github.com/users/gogoleff/following{/other_user}","gists_url":"https://api.github.com/users/gogoleff/gists{/gist_id}","starred_url":"https://api.github.com/users/gogoleff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gogoleff/subscriptions","organizations_url":"https://api.github.com/users/gogoleff/orgs","repos_url":"https://api.github.com/users/gogoleff/repos","events_url":"https://api.github.com/users/gogoleff/events{/privacy}","received_events_url":"https://api.github.com/users/gogoleff/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues/43/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/statuses/1ccfb4af56a3d754ada9fe271e224499497db3da","head":{"label":"KladovValery:master","ref":"master","sha":"1ccfb4af56a3d754ada9fe271e224499497db3da","user":{"login":"KladovValery","id":14982426,"avatar_url":"https://avatars.githubusercontent.com/u/14982426?v=3","gravatar_id":"","url":"https://api.github.com/users/KladovValery","html_url":"https://github.com/KladovValery","followers_url":"https://api.github.com/users/KladovValery/followers","following_url":"https://api.github.com/users/KladovValery/following{/other_user}","gists_url":"https://api.github.com/users/KladovValery/gists{/gist_id}","starred_url":"https://api.github.com/users/KladovValery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KladovValery/subscriptions","organizations_url":"https://api.github.com/users/KladovValery/orgs","repos_url":"https://api.github.com/users/KladovValery/repos","events_url":"https://api.github.com/users/KladovValery/events{/privacy}","received_events_url":"https://api.github.com/users/KladovValery/received_events","type":"User","site_admin":false},"repo":{"id":45405682,"name":"javascript-tasks-5","full_name":"KladovValery/javascript-tasks-5","owner":{"login":"KladovValery","id":14982426,"avatar_url":"https://avatars.githubusercontent.com/u/14982426?v=3","gravatar_id":"","url":"https://api.github.com/users/KladovValery","html_url":"https://github.com/KladovValery","followers_url":"https://api.github.com/users/KladovValery/followers","following_url":"https://api.github.com/users/KladovValery/following{/other_user}","gists_url":"https://api.github.com/users/KladovValery/gists{/gist_id}","starred_url":"https://api.github.com/users/KladovValery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KladovValery/subscriptions","organizations_url":"https://api.github.com/users/KladovValery/orgs","repos_url":"https://api.github.com/users/KladovValery/repos","events_url":"https://api.github.com/users/KladovValery/events{/privacy}","received_events_url":"https://api.github.com/users/KladovValery/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KladovValery/javascript-tasks-5","description":"Задача к лекции «This / Bind / Call / Apply» – «Пора на лекцию»","fork":true,"url":"https://api.github.com/repos/KladovValery/javascript-tasks-5","forks_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/forks","keys_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/teams","hooks_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/hooks","issue_events_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/issues/events{/number}","events_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/events","assignees_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/assignees{/user}","branches_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/branches{/branch}","tags_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/tags","blobs_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/git/refs{/sha}","trees_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/statuses/{sha}","languages_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/languages","stargazers_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/stargazers","contributors_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/contributors","subscribers_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/subscribers","subscription_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/subscription","commits_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/commits{/sha}","git_commits_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/git/commits{/sha}","comments_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/comments{/number}","issue_comment_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/issues/comments{/number}","contents_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/contents/{+path}","compare_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/merges","archive_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/downloads","issues_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/issues{/number}","pulls_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/pulls{/number}","milestones_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/milestones{/number}","notifications_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/labels{/name}","releases_url":"https://api.github.com/repos/KladovValery/javascript-tasks-5/releases{/id}","created_at":"2015-11-02T16:10:53Z","updated_at":"2015-11-02T16:10:54Z","pushed_at":"2015-11-09T20:53:22Z","git_url":"git://github.com/KladovValery/javascript-tasks-5.git","ssh_url":"git@github.com:KladovValery/javascript-tasks-5.git","clone_url":"https://github.com/KladovValery/javascript-tasks-5.git","svn_url":"https://github.com/KladovValery/javascript-tasks-5","homepage":"","size":98,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"urfu-2015:master","ref":"master","sha":"aaaa19f89cdb130a30ee9a3cb0909cda7e43222b","user":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":45039556,"name":"javascript-tasks-5","full_name":"urfu-2015/javascript-tasks-5","owner":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2015/javascript-tasks-5","description":"Задача к лекции «This / Bind / Call / Apply» – «Пора на лекцию»","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/releases{/id}","created_at":"2015-10-27T12:30:35Z","updated_at":"2015-10-27T13:29:31Z","pushed_at":"2015-11-09T20:53:22Z","git_url":"git://github.com/urfu-2015/javascript-tasks-5.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-5.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-5.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-5","homepage":"","size":1828,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":24,"forks":55,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-5/pull/43"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues/43"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-5/statuses/1ccfb4af56a3d754ada9fe271e224499497db3da"}}}}