{"action":"created","comment":{"url":"https://api.github.com/repos/pusher/pusher-js/pulls/comments/89124186","pull_request_review_id":9672298,"id":89124186,"diff_hunk":"@@ -21,18 +22,33 @@ export default class Dispatcher {\n     return this;\n   }\n \n-  bind_all(callback : Function) {\n+  bind_global(callback : Function) {\n     this.global_callbacks.push(callback);\n     return this;\n   }\n \n-  unbind(eventName : string, callback : Function, context?: any) {\n+  unbind(eventName? : string, callback? : Function, context?: any) {","path":"src/core/events/dispatcher.ts","position":19,"original_position":19,"commit_id":"fb0f89adbc021aef01a3abe4c7dbb8945173daea","original_commit_id":"fb0f89adbc021aef01a3abe4c7dbb8945173daea","user":{"login":"hph","id":1166565,"avatar_url":"https://avatars.githubusercontent.com/u/1166565?v=3","gravatar_id":"","url":"https://api.github.com/users/hph","html_url":"https://github.com/hph","followers_url":"https://api.github.com/users/hph/followers","following_url":"https://api.github.com/users/hph/following{/other_user}","gists_url":"https://api.github.com/users/hph/gists{/gist_id}","starred_url":"https://api.github.com/users/hph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hph/subscriptions","organizations_url":"https://api.github.com/users/hph/orgs","repos_url":"https://api.github.com/users/hph/repos","events_url":"https://api.github.com/users/hph/events{/privacy}","received_events_url":"https://api.github.com/users/hph/received_events","type":"User","site_admin":false},"body":"This API is a bit dangerous, since arguments passed to the function could resolve to undefined (to due a bug in a client's use of the library) and then that would result in unbinding all listeners. However, that should not be part of this PR.","created_at":"2016-11-22T14:21:04Z","updated_at":"2016-11-22T14:23:36Z","html_url":"https://github.com/pusher/pusher-js/pull/202#discussion_r89124186","pull_request_url":"https://api.github.com/repos/pusher/pusher-js/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/pusher/pusher-js/pulls/comments/89124186"},"html":{"href":"https://github.com/pusher/pusher-js/pull/202#discussion_r89124186"},"pull_request":{"href":"https://api.github.com/repos/pusher/pusher-js/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/pusher/pusher-js/pulls/202","id":94797744,"html_url":"https://github.com/pusher/pusher-js/pull/202","diff_url":"https://github.com/pusher/pusher-js/pull/202.diff","patch_url":"https://github.com/pusher/pusher-js/pull/202.patch","issue_url":"https://api.github.com/repos/pusher/pusher-js/issues/202","number":202,"state":"open","locked":false,"title":"Prod 1211 unbind all","user":{"login":"hot-leaf-juice","id":11499545,"avatar_url":"https://avatars.githubusercontent.com/u/11499545?v=3","gravatar_id":"","url":"https://api.github.com/users/hot-leaf-juice","html_url":"https://github.com/hot-leaf-juice","followers_url":"https://api.github.com/users/hot-leaf-juice/followers","following_url":"https://api.github.com/users/hot-leaf-juice/following{/other_user}","gists_url":"https://api.github.com/users/hot-leaf-juice/gists{/gist_id}","starred_url":"https://api.github.com/users/hot-leaf-juice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hot-leaf-juice/subscriptions","organizations_url":"https://api.github.com/users/hot-leaf-juice/orgs","repos_url":"https://api.github.com/users/hot-leaf-juice/repos","events_url":"https://api.github.com/users/hot-leaf-juice/events{/privacy}","received_events_url":"https://api.github.com/users/hot-leaf-juice/received_events","type":"User","site_admin":false},"body":"A customer pointed out that `unbind_all` didn't do what they expected. In particular it didn't reverse `bind_all`. Upon further inspection `unbind_all` was implemented identically to `unbind` and in fact all occurrences of `unbind_all()` can safely be replaced by `unbind()`. This also means that there is no way of removing global bindings (of the `bind_all` variety) short of directly mutating `channel.global_callbacks`.\r\n\r\nAfter discussion in Slack we came to the conclusion that an `unbind_all` method should do just that, remove *all* bindings, and that `bind_all` should be replaced by `bind_global` and it's inverse `unbind_global` to avoid ambiguity.\r\n\r\nThis is a breaking change, but any use of `unbind_all()` will continue to work as expected (unless anyone was exploiting the fact that `unbind_all()` previously left global bindings alone) and `bind_all` seems to have been discouraged in the docs, so the change to `bind_global` shouldn't affect a huge number of people.","created_at":"2016-11-22T11:42:33Z","updated_at":"2016-11-22T14:23:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6b3752720353200c7840d2ccaea683f49cc404e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pusher/pusher-js/pulls/202/commits","review_comments_url":"https://api.github.com/repos/pusher/pusher-js/pulls/202/comments","review_comment_url":"https://api.github.com/repos/pusher/pusher-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pusher/pusher-js/issues/202/comments","statuses_url":"https://api.github.com/repos/pusher/pusher-js/statuses/fb0f89adbc021aef01a3abe4c7dbb8945173daea","head":{"label":"pusher:PROD-1211-unbind_all","ref":"PROD-1211-unbind_all","sha":"fb0f89adbc021aef01a3abe4c7dbb8945173daea","user":{"login":"pusher","id":739550,"avatar_url":"https://avatars.githubusercontent.com/u/739550?v=3","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"repo":{"id":617902,"name":"pusher-js","full_name":"pusher/pusher-js","owner":{"login":"pusher","id":739550,"avatar_url":"https://avatars.githubusercontent.com/u/739550?v=3","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pusher/pusher-js","description":"Pusher Javascript library | owner=@hph","fork":false,"url":"https://api.github.com/repos/pusher/pusher-js","forks_url":"https://api.github.com/repos/pusher/pusher-js/forks","keys_url":"https://api.github.com/repos/pusher/pusher-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pusher/pusher-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pusher/pusher-js/teams","hooks_url":"https://api.github.com/repos/pusher/pusher-js/hooks","issue_events_url":"https://api.github.com/repos/pusher/pusher-js/issues/events{/number}","events_url":"https://api.github.com/repos/pusher/pusher-js/events","assignees_url":"https://api.github.com/repos/pusher/pusher-js/assignees{/user}","branches_url":"https://api.github.com/repos/pusher/pusher-js/branches{/branch}","tags_url":"https://api.github.com/repos/pusher/pusher-js/tags","blobs_url":"https://api.github.com/repos/pusher/pusher-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pusher/pusher-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pusher/pusher-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/pusher/pusher-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pusher/pusher-js/statuses/{sha}","languages_url":"https://api.github.com/repos/pusher/pusher-js/languages","stargazers_url":"https://api.github.com/repos/pusher/pusher-js/stargazers","contributors_url":"https://api.github.com/repos/pusher/pusher-js/contributors","subscribers_url":"https://api.github.com/repos/pusher/pusher-js/subscribers","subscription_url":"https://api.github.com/repos/pusher/pusher-js/subscription","commits_url":"https://api.github.com/repos/pusher/pusher-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/pusher/pusher-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/pusher/pusher-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/pusher/pusher-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/pusher/pusher-js/contents/{+path}","compare_url":"https://api.github.com/repos/pusher/pusher-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pusher/pusher-js/merges","archive_url":"https://api.github.com/repos/pusher/pusher-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pusher/pusher-js/downloads","issues_url":"https://api.github.com/repos/pusher/pusher-js/issues{/number}","pulls_url":"https://api.github.com/repos/pusher/pusher-js/pulls{/number}","milestones_url":"https://api.github.com/repos/pusher/pusher-js/milestones{/number}","notifications_url":"https://api.github.com/repos/pusher/pusher-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pusher/pusher-js/labels{/name}","releases_url":"https://api.github.com/repos/pusher/pusher-js/releases{/id}","deployments_url":"https://api.github.com/repos/pusher/pusher-js/deployments","created_at":"2010-04-19T15:04:12Z","updated_at":"2016-11-22T11:53:08Z","pushed_at":"2016-11-22T11:42:33Z","git_url":"git://github.com/pusher/pusher-js.git","ssh_url":"git@github.com:pusher/pusher-js.git","clone_url":"https://github.com/pusher/pusher-js.git","svn_url":"https://github.com/pusher/pusher-js","homepage":"http://pusher.com","size":5625,"stargazers_count":611,"watchers_count":611,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":29,"forks":157,"open_issues":29,"watchers":611,"default_branch":"master"}},"base":{"label":"pusher:master","ref":"master","sha":"0bb37df0d479ac8aaec89f186943a9cc6e11fcbe","user":{"login":"pusher","id":739550,"avatar_url":"https://avatars.githubusercontent.com/u/739550?v=3","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"repo":{"id":617902,"name":"pusher-js","full_name":"pusher/pusher-js","owner":{"login":"pusher","id":739550,"avatar_url":"https://avatars.githubusercontent.com/u/739550?v=3","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pusher/pusher-js","description":"Pusher Javascript library | owner=@hph","fork":false,"url":"https://api.github.com/repos/pusher/pusher-js","forks_url":"https://api.github.com/repos/pusher/pusher-js/forks","keys_url":"https://api.github.com/repos/pusher/pusher-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pusher/pusher-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pusher/pusher-js/teams","hooks_url":"https://api.github.com/repos/pusher/pusher-js/hooks","issue_events_url":"https://api.github.com/repos/pusher/pusher-js/issues/events{/number}","events_url":"https://api.github.com/repos/pusher/pusher-js/events","assignees_url":"https://api.github.com/repos/pusher/pusher-js/assignees{/user}","branches_url":"https://api.github.com/repos/pusher/pusher-js/branches{/branch}","tags_url":"https://api.github.com/repos/pusher/pusher-js/tags","blobs_url":"https://api.github.com/repos/pusher/pusher-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pusher/pusher-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pusher/pusher-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/pusher/pusher-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pusher/pusher-js/statuses/{sha}","languages_url":"https://api.github.com/repos/pusher/pusher-js/languages","stargazers_url":"https://api.github.com/repos/pusher/pusher-js/stargazers","contributors_url":"https://api.github.com/repos/pusher/pusher-js/contributors","subscribers_url":"https://api.github.com/repos/pusher/pusher-js/subscribers","subscription_url":"https://api.github.com/repos/pusher/pusher-js/subscription","commits_url":"https://api.github.com/repos/pusher/pusher-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/pusher/pusher-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/pusher/pusher-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/pusher/pusher-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/pusher/pusher-js/contents/{+path}","compare_url":"https://api.github.com/repos/pusher/pusher-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pusher/pusher-js/merges","archive_url":"https://api.github.com/repos/pusher/pusher-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pusher/pusher-js/downloads","issues_url":"https://api.github.com/repos/pusher/pusher-js/issues{/number}","pulls_url":"https://api.github.com/repos/pusher/pusher-js/pulls{/number}","milestones_url":"https://api.github.com/repos/pusher/pusher-js/milestones{/number}","notifications_url":"https://api.github.com/repos/pusher/pusher-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pusher/pusher-js/labels{/name}","releases_url":"https://api.github.com/repos/pusher/pusher-js/releases{/id}","deployments_url":"https://api.github.com/repos/pusher/pusher-js/deployments","created_at":"2010-04-19T15:04:12Z","updated_at":"2016-11-22T11:53:08Z","pushed_at":"2016-11-22T11:42:33Z","git_url":"git://github.com/pusher/pusher-js.git","ssh_url":"git@github.com:pusher/pusher-js.git","clone_url":"https://github.com/pusher/pusher-js.git","svn_url":"https://github.com/pusher/pusher-js","homepage":"http://pusher.com","size":5625,"stargazers_count":611,"watchers_count":611,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":29,"forks":157,"open_issues":29,"watchers":611,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pusher/pusher-js/pulls/202"},"html":{"href":"https://github.com/pusher/pusher-js/pull/202"},"issue":{"href":"https://api.github.com/repos/pusher/pusher-js/issues/202"},"comments":{"href":"https://api.github.com/repos/pusher/pusher-js/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/pusher/pusher-js/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/pusher/pusher-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pusher/pusher-js/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/pusher/pusher-js/statuses/fb0f89adbc021aef01a3abe4c7dbb8945173daea"}}}}
{"actor":{"display_login":"hph"}}