{"action":"created","comment":{"url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments/72946897","id":72946897,"diff_hunk":"@@ -0,0 +1,100 @@\n+/* @flow */\n+\n+/* This Source Code Form is subject to the terms of the Mozilla Public\n+ * License, v. 2.0. If a copy of the MPL was not distributed with this\n+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n+\n+import {Task} from \"reflex\";\n+import {ok, error} from \"../common/result\";\n+import * as Search from \"../browser/Navigators/Navigator/Assistant/Search\"\n+\n+const pendingRequests = Object.create(null);\n+\n+export const query =\n+  (query:string, limit:number=100):Task<Error, Array<Search.Match>> =>\n+  new Task((succeed, fail) => {\n+    const request = new XMLHttpRequest({ mozSystem: true })\n+    pendingRequests[query] = request\n+    const url = `https://ac.duckduckgo.com/ac/?q=${query}&type=list`\n+    request.open('GET', url, true)\n+    request.responseType = 'json'\n+\n+    request.onerror = event => {\n+      delete pendingRequests[query]\n+      fail(Error(`Network request to ${url} has failed: ${request.statusText}`))\n+    }","path":"src/Service/Search.js","position":25,"original_position":25,"commit_id":"85efc112668b82e260787d7c893372583c8881ba","original_commit_id":"85efc112668b82e260787d7c893372583c8881ba","user":{"login":"paulrouget","id":373579,"avatar_url":"https://avatars.githubusercontent.com/u/373579?v=3","gravatar_id":"","url":"https://api.github.com/users/paulrouget","html_url":"https://github.com/paulrouget","followers_url":"https://api.github.com/users/paulrouget/followers","following_url":"https://api.github.com/users/paulrouget/following{/other_user}","gists_url":"https://api.github.com/users/paulrouget/gists{/gist_id}","starred_url":"https://api.github.com/users/paulrouget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulrouget/subscriptions","organizations_url":"https://api.github.com/users/paulrouget/orgs","repos_url":"https://api.github.com/users/paulrouget/repos","events_url":"https://api.github.com/users/paulrouget/events{/privacy}","received_events_url":"https://api.github.com/users/paulrouget/received_events","type":"User","site_admin":false},"body":"Probably want to add `onabort` here…","created_at":"2016-08-01T09:20:21Z","updated_at":"2016-08-01T09:20:21Z","html_url":"https://github.com/browserhtml/browserhtml/pull/1194#discussion_r72946897","pull_request_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194","_links":{"self":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments/72946897"},"html":{"href":"https://github.com/browserhtml/browserhtml/pull/1194#discussion_r72946897"},"pull_request":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194"}}},"pull_request":{"url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194","id":79272816,"html_url":"https://github.com/browserhtml/browserhtml/pull/1194","diff_url":"https://github.com/browserhtml/browserhtml/pull/1194.diff","patch_url":"https://github.com/browserhtml/browserhtml/pull/1194.patch","issue_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/1194","number":1194,"state":"open","locked":false,"title":"Factor out services form the History and Search modules.","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"body":"## This is part of the #1185 and is based on top of #1195\r\n\r\nThis change factors out IO stuff from `Search` and `History` modules into separate service modules.\r\n","created_at":"2016-07-28T21:35:33Z","updated_at":"2016-08-01T09:20:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81cac424199758a9313ba8ae0b3d0631fea6cbb6","assignee":{"login":"paulrouget","id":373579,"avatar_url":"https://avatars.githubusercontent.com/u/373579?v=3","gravatar_id":"","url":"https://api.github.com/users/paulrouget","html_url":"https://github.com/paulrouget","followers_url":"https://api.github.com/users/paulrouget/followers","following_url":"https://api.github.com/users/paulrouget/following{/other_user}","gists_url":"https://api.github.com/users/paulrouget/gists{/gist_id}","starred_url":"https://api.github.com/users/paulrouget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulrouget/subscriptions","organizations_url":"https://api.github.com/users/paulrouget/orgs","repos_url":"https://api.github.com/users/paulrouget/repos","events_url":"https://api.github.com/users/paulrouget/events{/privacy}","received_events_url":"https://api.github.com/users/paulrouget/received_events","type":"User","site_admin":false},"assignees":[{"login":"paulrouget","id":373579,"avatar_url":"https://avatars.githubusercontent.com/u/373579?v=3","gravatar_id":"","url":"https://api.github.com/users/paulrouget","html_url":"https://github.com/paulrouget","followers_url":"https://api.github.com/users/paulrouget/followers","following_url":"https://api.github.com/users/paulrouget/following{/other_user}","gists_url":"https://api.github.com/users/paulrouget/gists{/gist_id}","starred_url":"https://api.github.com/users/paulrouget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulrouget/subscriptions","organizations_url":"https://api.github.com/users/paulrouget/orgs","repos_url":"https://api.github.com/users/paulrouget/repos","events_url":"https://api.github.com/users/paulrouget/events{/privacy}","received_events_url":"https://api.github.com/users/paulrouget/received_events","type":"User","site_admin":false},{"login":"jsantell","id":641267,"avatar_url":"https://avatars.githubusercontent.com/u/641267?v=3","gravatar_id":"","url":"https://api.github.com/users/jsantell","html_url":"https://github.com/jsantell","followers_url":"https://api.github.com/users/jsantell/followers","following_url":"https://api.github.com/users/jsantell/following{/other_user}","gists_url":"https://api.github.com/users/jsantell/gists{/gist_id}","starred_url":"https://api.github.com/users/jsantell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsantell/subscriptions","organizations_url":"https://api.github.com/users/jsantell/orgs","repos_url":"https://api.github.com/users/jsantell/repos","events_url":"https://api.github.com/users/jsantell/events{/privacy}","received_events_url":"https://api.github.com/users/jsantell/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194/commits","review_comments_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194/comments","review_comment_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/1194/comments","statuses_url":"https://api.github.com/repos/browserhtml/browserhtml/statuses/85efc112668b82e260787d7c893372583c8881ba","head":{"label":"Gozala:factor-out-services","ref":"factor-out-services","sha":"85efc112668b82e260787d7c893372583c8881ba","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"repo":{"id":28829395,"name":"browser.html","full_name":"Gozala/browser.html","owner":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gozala/browser.html","description":"Experimental browser built in HTML","fork":true,"url":"https://api.github.com/repos/Gozala/browser.html","forks_url":"https://api.github.com/repos/Gozala/browser.html/forks","keys_url":"https://api.github.com/repos/Gozala/browser.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gozala/browser.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gozala/browser.html/teams","hooks_url":"https://api.github.com/repos/Gozala/browser.html/hooks","issue_events_url":"https://api.github.com/repos/Gozala/browser.html/issues/events{/number}","events_url":"https://api.github.com/repos/Gozala/browser.html/events","assignees_url":"https://api.github.com/repos/Gozala/browser.html/assignees{/user}","branches_url":"https://api.github.com/repos/Gozala/browser.html/branches{/branch}","tags_url":"https://api.github.com/repos/Gozala/browser.html/tags","blobs_url":"https://api.github.com/repos/Gozala/browser.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gozala/browser.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gozala/browser.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gozala/browser.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gozala/browser.html/statuses/{sha}","languages_url":"https://api.github.com/repos/Gozala/browser.html/languages","stargazers_url":"https://api.github.com/repos/Gozala/browser.html/stargazers","contributors_url":"https://api.github.com/repos/Gozala/browser.html/contributors","subscribers_url":"https://api.github.com/repos/Gozala/browser.html/subscribers","subscription_url":"https://api.github.com/repos/Gozala/browser.html/subscription","commits_url":"https://api.github.com/repos/Gozala/browser.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gozala/browser.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gozala/browser.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gozala/browser.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gozala/browser.html/contents/{+path}","compare_url":"https://api.github.com/repos/Gozala/browser.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gozala/browser.html/merges","archive_url":"https://api.github.com/repos/Gozala/browser.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gozala/browser.html/downloads","issues_url":"https://api.github.com/repos/Gozala/browser.html/issues{/number}","pulls_url":"https://api.github.com/repos/Gozala/browser.html/pulls{/number}","milestones_url":"https://api.github.com/repos/Gozala/browser.html/milestones{/number}","notifications_url":"https://api.github.com/repos/Gozala/browser.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gozala/browser.html/labels{/name}","releases_url":"https://api.github.com/repos/Gozala/browser.html/releases{/id}","deployments_url":"https://api.github.com/repos/Gozala/browser.html/deployments","created_at":"2015-01-05T20:07:15Z","updated_at":"2016-02-12T22:23:43Z","pushed_at":"2016-07-29T23:55:26Z","git_url":"git://github.com/Gozala/browser.html.git","ssh_url":"git@github.com:Gozala/browser.html.git","clone_url":"https://github.com/Gozala/browser.html.git","svn_url":"https://github.com/Gozala/browser.html","homepage":null,"size":22359,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"browserhtml:master","ref":"master","sha":"e76c4ce9d85acec365dd614dc37fae54ec056af7","user":{"login":"browserhtml","id":16613745,"avatar_url":"https://avatars.githubusercontent.com/u/16613745?v=3","gravatar_id":"","url":"https://api.github.com/users/browserhtml","html_url":"https://github.com/browserhtml","followers_url":"https://api.github.com/users/browserhtml/followers","following_url":"https://api.github.com/users/browserhtml/following{/other_user}","gists_url":"https://api.github.com/users/browserhtml/gists{/gist_id}","starred_url":"https://api.github.com/users/browserhtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browserhtml/subscriptions","organizations_url":"https://api.github.com/users/browserhtml/orgs","repos_url":"https://api.github.com/users/browserhtml/repos","events_url":"https://api.github.com/users/browserhtml/events{/privacy}","received_events_url":"https://api.github.com/users/browserhtml/received_events","type":"Organization","site_admin":false},"repo":{"id":28800891,"name":"browserhtml","full_name":"browserhtml/browserhtml","owner":{"login":"browserhtml","id":16613745,"avatar_url":"https://avatars.githubusercontent.com/u/16613745?v=3","gravatar_id":"","url":"https://api.github.com/users/browserhtml","html_url":"https://github.com/browserhtml","followers_url":"https://api.github.com/users/browserhtml/followers","following_url":"https://api.github.com/users/browserhtml/following{/other_user}","gists_url":"https://api.github.com/users/browserhtml/gists{/gist_id}","starred_url":"https://api.github.com/users/browserhtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browserhtml/subscriptions","organizations_url":"https://api.github.com/users/browserhtml/orgs","repos_url":"https://api.github.com/users/browserhtml/repos","events_url":"https://api.github.com/users/browserhtml/events{/privacy}","received_events_url":"https://api.github.com/users/browserhtml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/browserhtml/browserhtml","description":"Experimental Servo browser built in HTML","fork":false,"url":"https://api.github.com/repos/browserhtml/browserhtml","forks_url":"https://api.github.com/repos/browserhtml/browserhtml/forks","keys_url":"https://api.github.com/repos/browserhtml/browserhtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/browserhtml/browserhtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/browserhtml/browserhtml/teams","hooks_url":"https://api.github.com/repos/browserhtml/browserhtml/hooks","issue_events_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/events{/number}","events_url":"https://api.github.com/repos/browserhtml/browserhtml/events","assignees_url":"https://api.github.com/repos/browserhtml/browserhtml/assignees{/user}","branches_url":"https://api.github.com/repos/browserhtml/browserhtml/branches{/branch}","tags_url":"https://api.github.com/repos/browserhtml/browserhtml/tags","blobs_url":"https://api.github.com/repos/browserhtml/browserhtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/browserhtml/browserhtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/browserhtml/browserhtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/browserhtml/browserhtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/browserhtml/browserhtml/statuses/{sha}","languages_url":"https://api.github.com/repos/browserhtml/browserhtml/languages","stargazers_url":"https://api.github.com/repos/browserhtml/browserhtml/stargazers","contributors_url":"https://api.github.com/repos/browserhtml/browserhtml/contributors","subscribers_url":"https://api.github.com/repos/browserhtml/browserhtml/subscribers","subscription_url":"https://api.github.com/repos/browserhtml/browserhtml/subscription","commits_url":"https://api.github.com/repos/browserhtml/browserhtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/browserhtml/browserhtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/browserhtml/browserhtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/browserhtml/browserhtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/browserhtml/browserhtml/contents/{+path}","compare_url":"https://api.github.com/repos/browserhtml/browserhtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/browserhtml/browserhtml/merges","archive_url":"https://api.github.com/repos/browserhtml/browserhtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/browserhtml/browserhtml/downloads","issues_url":"https://api.github.com/repos/browserhtml/browserhtml/issues{/number}","pulls_url":"https://api.github.com/repos/browserhtml/browserhtml/pulls{/number}","milestones_url":"https://api.github.com/repos/browserhtml/browserhtml/milestones{/number}","notifications_url":"https://api.github.com/repos/browserhtml/browserhtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/browserhtml/browserhtml/labels{/name}","releases_url":"https://api.github.com/repos/browserhtml/browserhtml/releases{/id}","deployments_url":"https://api.github.com/repos/browserhtml/browserhtml/deployments","created_at":"2015-01-05T06:39:24Z","updated_at":"2016-07-31T07:42:37Z","pushed_at":"2016-07-29T23:55:59Z","git_url":"git://github.com/browserhtml/browserhtml.git","ssh_url":"git@github.com:browserhtml/browserhtml.git","clone_url":"https://github.com/browserhtml/browserhtml.git","svn_url":"https://github.com/browserhtml/browserhtml","homepage":"","size":70598,"stargazers_count":1838,"watchers_count":1838,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":125,"mirror_url":null,"open_issues_count":113,"forks":125,"open_issues":113,"watchers":1838,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194"},"html":{"href":"https://github.com/browserhtml/browserhtml/pull/1194"},"issue":{"href":"https://api.github.com/repos/browserhtml/browserhtml/issues/1194"},"comments":{"href":"https://api.github.com/repos/browserhtml/browserhtml/issues/1194/comments"},"review_comments":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194/comments"},"review_comment":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/browserhtml/browserhtml/pulls/1194/commits"},"statuses":{"href":"https://api.github.com/repos/browserhtml/browserhtml/statuses/85efc112668b82e260787d7c893372583c8881ba"}}}}
{"actor":{"display_login":"paulrouget"}}