{"action":"created","comment":{"url":"https://api.github.com/repos/relateiq/escape-stack/pulls/comments/67757288","id":67757288,"diff_hunk":"@@ -0,0 +1,24 @@\n+///<reference path=\"../typings/index.d.ts\" />\n+import { EscapeStack } from './EscapeStack';\n+import { handleEscapeKeydown } from './domEventHandler';\n+\n+let globalStack;\n+\n+const es = new EscapeStack();\n+handleEscapeKeydown(document.body, es.pop);\n+\n+function createEscapeStack(global: boolean = false) {\n+    const es = new EscapeStack();\n+    handleEscapeKeydown(document.body, es.pop);","path":"src/index.ts","position":12,"original_position":12,"commit_id":"97237b1f61e85a9cfc2cd1112eeac98b7a45396a","original_commit_id":"97237b1f61e85a9cfc2cd1112eeac98b7a45396a","user":{"login":"joechrz","id":102943,"avatar_url":"https://avatars.githubusercontent.com/u/102943?v=3","gravatar_id":"","url":"https://api.github.com/users/joechrz","html_url":"https://github.com/joechrz","followers_url":"https://api.github.com/users/joechrz/followers","following_url":"https://api.github.com/users/joechrz/following{/other_user}","gists_url":"https://api.github.com/users/joechrz/gists{/gist_id}","starred_url":"https://api.github.com/users/joechrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joechrz/subscriptions","organizations_url":"https://api.github.com/users/joechrz/orgs","repos_url":"https://api.github.com/users/joechrz/repos","events_url":"https://api.github.com/users/joechrz/events{/privacy}","received_events_url":"https://api.github.com/users/joechrz/received_events","type":"User","site_admin":false},"body":"It looks like this behavior is a little different from the old logic:\r\n\r\n```javascript\r\nmodule.exports = function(global) {\t\t\r\n    if (!global) {\t\t\r\n        return makeStack();\t\t\r\n    }\t\t\r\n\t\t\r\n    if (!globalStack) {\t\t\r\n        globalStack = makeStack();\t\t\r\n    }\t\t\r\n    return globalStack;\t\t\r\n};\r\n```\r\n\r\nIn the old logic, a new `EscapeStack` was created only when global was false, but here it looks like it happens every time, so there's a chance that this new object is never actually used.\r\n\r\nYou can probably just refactor these 2 lines into a `makeStack()` function and then use the exact same code as before.","created_at":"2016-06-20T20:09:50Z","updated_at":"2016-06-20T20:09:50Z","html_url":"https://github.com/relateiq/escape-stack/pull/3#discussion_r67757288","pull_request_url":"https://api.github.com/repos/relateiq/escape-stack/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/relateiq/escape-stack/pulls/comments/67757288"},"html":{"href":"https://github.com/relateiq/escape-stack/pull/3#discussion_r67757288"},"pull_request":{"href":"https://api.github.com/repos/relateiq/escape-stack/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/relateiq/escape-stack/pulls/3","id":74492691,"html_url":"https://github.com/relateiq/escape-stack/pull/3","diff_url":"https://github.com/relateiq/escape-stack/pull/3.diff","patch_url":"https://github.com/relateiq/escape-stack/pull/3.patch","issue_url":"https://api.github.com/repos/relateiq/escape-stack/issues/3","number":3,"state":"open","locked":false,"title":"Typescript conversion","user":{"login":"vrunjeti","id":6979696,"avatar_url":"https://avatars.githubusercontent.com/u/6979696?v=3","gravatar_id":"","url":"https://api.github.com/users/vrunjeti","html_url":"https://github.com/vrunjeti","followers_url":"https://api.github.com/users/vrunjeti/followers","following_url":"https://api.github.com/users/vrunjeti/following{/other_user}","gists_url":"https://api.github.com/users/vrunjeti/gists{/gist_id}","starred_url":"https://api.github.com/users/vrunjeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrunjeti/subscriptions","organizations_url":"https://api.github.com/users/vrunjeti/orgs","repos_url":"https://api.github.com/users/vrunjeti/repos","events_url":"https://api.github.com/users/vrunjeti/events{/privacy}","received_events_url":"https://api.github.com/users/vrunjeti/received_events","type":"User","site_admin":false},"body":"- Set up and converted to Typescript\r\n- Separated stack logic and dom interaction","created_at":"2016-06-20T18:45:42Z","updated_at":"2016-06-20T20:09:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a499179b8cc1249a171e6faea215f8bb9cf26b4","assignee":{"login":"joechrz","id":102943,"avatar_url":"https://avatars.githubusercontent.com/u/102943?v=3","gravatar_id":"","url":"https://api.github.com/users/joechrz","html_url":"https://github.com/joechrz","followers_url":"https://api.github.com/users/joechrz/followers","following_url":"https://api.github.com/users/joechrz/following{/other_user}","gists_url":"https://api.github.com/users/joechrz/gists{/gist_id}","starred_url":"https://api.github.com/users/joechrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joechrz/subscriptions","organizations_url":"https://api.github.com/users/joechrz/orgs","repos_url":"https://api.github.com/users/joechrz/repos","events_url":"https://api.github.com/users/joechrz/events{/privacy}","received_events_url":"https://api.github.com/users/joechrz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/relateiq/escape-stack/pulls/3/commits","review_comments_url":"https://api.github.com/repos/relateiq/escape-stack/pulls/3/comments","review_comment_url":"https://api.github.com/repos/relateiq/escape-stack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/relateiq/escape-stack/issues/3/comments","statuses_url":"https://api.github.com/repos/relateiq/escape-stack/statuses/97237b1f61e85a9cfc2cd1112eeac98b7a45396a","head":{"label":"relateiq:typescript-conversion","ref":"typescript-conversion","sha":"97237b1f61e85a9cfc2cd1112eeac98b7a45396a","user":{"login":"relateiq","id":1335810,"avatar_url":"https://avatars.githubusercontent.com/u/1335810?v=3","gravatar_id":"","url":"https://api.github.com/users/relateiq","html_url":"https://github.com/relateiq","followers_url":"https://api.github.com/users/relateiq/followers","following_url":"https://api.github.com/users/relateiq/following{/other_user}","gists_url":"https://api.github.com/users/relateiq/gists{/gist_id}","starred_url":"https://api.github.com/users/relateiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relateiq/subscriptions","organizations_url":"https://api.github.com/users/relateiq/orgs","repos_url":"https://api.github.com/users/relateiq/repos","events_url":"https://api.github.com/users/relateiq/events{/privacy}","received_events_url":"https://api.github.com/users/relateiq/received_events","type":"Organization","site_admin":false},"repo":{"id":55733558,"name":"escape-stack","full_name":"relateiq/escape-stack","owner":{"login":"relateiq","id":1335810,"avatar_url":"https://avatars.githubusercontent.com/u/1335810?v=3","gravatar_id":"","url":"https://api.github.com/users/relateiq","html_url":"https://github.com/relateiq","followers_url":"https://api.github.com/users/relateiq/followers","following_url":"https://api.github.com/users/relateiq/following{/other_user}","gists_url":"https://api.github.com/users/relateiq/gists{/gist_id}","starred_url":"https://api.github.com/users/relateiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relateiq/subscriptions","organizations_url":"https://api.github.com/users/relateiq/orgs","repos_url":"https://api.github.com/users/relateiq/repos","events_url":"https://api.github.com/users/relateiq/events{/privacy}","received_events_url":"https://api.github.com/users/relateiq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/relateiq/escape-stack","description":null,"fork":false,"url":"https://api.github.com/repos/relateiq/escape-stack","forks_url":"https://api.github.com/repos/relateiq/escape-stack/forks","keys_url":"https://api.github.com/repos/relateiq/escape-stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/relateiq/escape-stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/relateiq/escape-stack/teams","hooks_url":"https://api.github.com/repos/relateiq/escape-stack/hooks","issue_events_url":"https://api.github.com/repos/relateiq/escape-stack/issues/events{/number}","events_url":"https://api.github.com/repos/relateiq/escape-stack/events","assignees_url":"https://api.github.com/repos/relateiq/escape-stack/assignees{/user}","branches_url":"https://api.github.com/repos/relateiq/escape-stack/branches{/branch}","tags_url":"https://api.github.com/repos/relateiq/escape-stack/tags","blobs_url":"https://api.github.com/repos/relateiq/escape-stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/relateiq/escape-stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/relateiq/escape-stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/relateiq/escape-stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/relateiq/escape-stack/statuses/{sha}","languages_url":"https://api.github.com/repos/relateiq/escape-stack/languages","stargazers_url":"https://api.github.com/repos/relateiq/escape-stack/stargazers","contributors_url":"https://api.github.com/repos/relateiq/escape-stack/contributors","subscribers_url":"https://api.github.com/repos/relateiq/escape-stack/subscribers","subscription_url":"https://api.github.com/repos/relateiq/escape-stack/subscription","commits_url":"https://api.github.com/repos/relateiq/escape-stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/relateiq/escape-stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/relateiq/escape-stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/relateiq/escape-stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/relateiq/escape-stack/contents/{+path}","compare_url":"https://api.github.com/repos/relateiq/escape-stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/relateiq/escape-stack/merges","archive_url":"https://api.github.com/repos/relateiq/escape-stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/relateiq/escape-stack/downloads","issues_url":"https://api.github.com/repos/relateiq/escape-stack/issues{/number}","pulls_url":"https://api.github.com/repos/relateiq/escape-stack/pulls{/number}","milestones_url":"https://api.github.com/repos/relateiq/escape-stack/milestones{/number}","notifications_url":"https://api.github.com/repos/relateiq/escape-stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/relateiq/escape-stack/labels{/name}","releases_url":"https://api.github.com/repos/relateiq/escape-stack/releases{/id}","deployments_url":"https://api.github.com/repos/relateiq/escape-stack/deployments","created_at":"2016-04-07T22:56:12Z","updated_at":"2016-04-07T22:57:29Z","pushed_at":"2016-06-20T18:54:08Z","git_url":"git://github.com/relateiq/escape-stack.git","ssh_url":"git@github.com:relateiq/escape-stack.git","clone_url":"https://github.com/relateiq/escape-stack.git","svn_url":"https://github.com/relateiq/escape-stack","homepage":null,"size":32,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"relateiq:master","ref":"master","sha":"9775122a57aef5493da6fe4f7180a7a6e86c79ae","user":{"login":"relateiq","id":1335810,"avatar_url":"https://avatars.githubusercontent.com/u/1335810?v=3","gravatar_id":"","url":"https://api.github.com/users/relateiq","html_url":"https://github.com/relateiq","followers_url":"https://api.github.com/users/relateiq/followers","following_url":"https://api.github.com/users/relateiq/following{/other_user}","gists_url":"https://api.github.com/users/relateiq/gists{/gist_id}","starred_url":"https://api.github.com/users/relateiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relateiq/subscriptions","organizations_url":"https://api.github.com/users/relateiq/orgs","repos_url":"https://api.github.com/users/relateiq/repos","events_url":"https://api.github.com/users/relateiq/events{/privacy}","received_events_url":"https://api.github.com/users/relateiq/received_events","type":"Organization","site_admin":false},"repo":{"id":55733558,"name":"escape-stack","full_name":"relateiq/escape-stack","owner":{"login":"relateiq","id":1335810,"avatar_url":"https://avatars.githubusercontent.com/u/1335810?v=3","gravatar_id":"","url":"https://api.github.com/users/relateiq","html_url":"https://github.com/relateiq","followers_url":"https://api.github.com/users/relateiq/followers","following_url":"https://api.github.com/users/relateiq/following{/other_user}","gists_url":"https://api.github.com/users/relateiq/gists{/gist_id}","starred_url":"https://api.github.com/users/relateiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relateiq/subscriptions","organizations_url":"https://api.github.com/users/relateiq/orgs","repos_url":"https://api.github.com/users/relateiq/repos","events_url":"https://api.github.com/users/relateiq/events{/privacy}","received_events_url":"https://api.github.com/users/relateiq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/relateiq/escape-stack","description":null,"fork":false,"url":"https://api.github.com/repos/relateiq/escape-stack","forks_url":"https://api.github.com/repos/relateiq/escape-stack/forks","keys_url":"https://api.github.com/repos/relateiq/escape-stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/relateiq/escape-stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/relateiq/escape-stack/teams","hooks_url":"https://api.github.com/repos/relateiq/escape-stack/hooks","issue_events_url":"https://api.github.com/repos/relateiq/escape-stack/issues/events{/number}","events_url":"https://api.github.com/repos/relateiq/escape-stack/events","assignees_url":"https://api.github.com/repos/relateiq/escape-stack/assignees{/user}","branches_url":"https://api.github.com/repos/relateiq/escape-stack/branches{/branch}","tags_url":"https://api.github.com/repos/relateiq/escape-stack/tags","blobs_url":"https://api.github.com/repos/relateiq/escape-stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/relateiq/escape-stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/relateiq/escape-stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/relateiq/escape-stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/relateiq/escape-stack/statuses/{sha}","languages_url":"https://api.github.com/repos/relateiq/escape-stack/languages","stargazers_url":"https://api.github.com/repos/relateiq/escape-stack/stargazers","contributors_url":"https://api.github.com/repos/relateiq/escape-stack/contributors","subscribers_url":"https://api.github.com/repos/relateiq/escape-stack/subscribers","subscription_url":"https://api.github.com/repos/relateiq/escape-stack/subscription","commits_url":"https://api.github.com/repos/relateiq/escape-stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/relateiq/escape-stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/relateiq/escape-stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/relateiq/escape-stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/relateiq/escape-stack/contents/{+path}","compare_url":"https://api.github.com/repos/relateiq/escape-stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/relateiq/escape-stack/merges","archive_url":"https://api.github.com/repos/relateiq/escape-stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/relateiq/escape-stack/downloads","issues_url":"https://api.github.com/repos/relateiq/escape-stack/issues{/number}","pulls_url":"https://api.github.com/repos/relateiq/escape-stack/pulls{/number}","milestones_url":"https://api.github.com/repos/relateiq/escape-stack/milestones{/number}","notifications_url":"https://api.github.com/repos/relateiq/escape-stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/relateiq/escape-stack/labels{/name}","releases_url":"https://api.github.com/repos/relateiq/escape-stack/releases{/id}","deployments_url":"https://api.github.com/repos/relateiq/escape-stack/deployments","created_at":"2016-04-07T22:56:12Z","updated_at":"2016-04-07T22:57:29Z","pushed_at":"2016-06-20T18:54:08Z","git_url":"git://github.com/relateiq/escape-stack.git","ssh_url":"git@github.com:relateiq/escape-stack.git","clone_url":"https://github.com/relateiq/escape-stack.git","svn_url":"https://github.com/relateiq/escape-stack","homepage":null,"size":32,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/relateiq/escape-stack/pulls/3"},"html":{"href":"https://github.com/relateiq/escape-stack/pull/3"},"issue":{"href":"https://api.github.com/repos/relateiq/escape-stack/issues/3"},"comments":{"href":"https://api.github.com/repos/relateiq/escape-stack/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/relateiq/escape-stack/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/relateiq/escape-stack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/relateiq/escape-stack/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/relateiq/escape-stack/statuses/97237b1f61e85a9cfc2cd1112eeac98b7a45396a"}}}}
{"actor":{"display_login":"joechrz"}}