{"action":"created","comment":{"url":"https://api.github.com/repos/iTowns/itowns2/pulls/comments/88680203","pull_request_review_id":9248084,"id":88680203,"diff_hunk":"@@ -0,0 +1,41 @@\n+import { TextureLoader } from 'three';\n+\n+let textureLoader = new TextureLoader();\n+\n+function checkResponse(response) {\n+    if (response.status < 200 || response.status >= 300) {\n+        var error = new Error(`Error loading ${response.url}: status ${response.status}`);\n+        error.status = response.status;\n+        throw error;\n+    }\n+}\n+\n+let Fetcher = {\n+\n+    json: function(url) {\n+        return fetch(url).then(response => {\n+            checkResponse(response);\n+            return response.json();\n+        });\n+    },\n+\n+    xml: function(url) {\n+        return fetch(url).then(response => {\n+            checkResponse(response);\n+            return new window.DOMParser().parseFromString(response.text(), 'text/xml');\n+        });\n+    },\n+\n+    texture: function(url) {\n+        let res, rej;\n+        let promise = new Promise(function(resolve, reject) {\n+            res = resolve;\n+            rej = reject;\n+        });\n+\n+        let texture = textureLoader.load(url, res, () => {}, rej);\n+        return {texture, promise};\n+    }\n+}\n+\n+export default Fetcher;","path":"src/Core/Commander/Providers/Fetcher.js","position":41,"original_position":41,"commit_id":"d6763a7c838c159f129b14e940e3f74b9cba55f4","original_commit_id":"d6763a7c838c159f129b14e940e3f74b9cba55f4","user":{"login":"tbroyer","id":173813,"avatar_url":"https://avatars.githubusercontent.com/u/173813?v=3","gravatar_id":"","url":"https://api.github.com/users/tbroyer","html_url":"https://github.com/tbroyer","followers_url":"https://api.github.com/users/tbroyer/followers","following_url":"https://api.github.com/users/tbroyer/following{/other_user}","gists_url":"https://api.github.com/users/tbroyer/gists{/gist_id}","starred_url":"https://api.github.com/users/tbroyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbroyer/subscriptions","organizations_url":"https://api.github.com/users/tbroyer/orgs","repos_url":"https://api.github.com/users/tbroyer/repos","events_url":"https://api.github.com/users/tbroyer/events{/privacy}","received_events_url":"https://api.github.com/users/tbroyer/received_events","type":"User","site_admin":false},"body":"Instead of `export default Fetcher` how about exporting each function instead?\r\n\r\n```js\r\nexport function json(url) {\r\n   …\r\n}\r\nexport function xml(url) {\r\n   …\r\n}\r\nexport function texture(url) {\r\n   …\r\n}\r\n```","created_at":"2016-11-18T15:43:56Z","updated_at":"2016-11-18T15:45:23Z","html_url":"https://github.com/iTowns/itowns2/pull/211#discussion_r88680203","pull_request_url":"https://api.github.com/repos/iTowns/itowns2/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/comments/88680203"},"html":{"href":"https://github.com/iTowns/itowns2/pull/211#discussion_r88680203"},"pull_request":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/iTowns/itowns2/pulls/211","id":94381005,"html_url":"https://github.com/iTowns/itowns2/pull/211","diff_url":"https://github.com/iTowns/itowns2/pull/211.diff","patch_url":"https://github.com/iTowns/itowns2/pull/211.patch","issue_url":"https://api.github.com/repos/iTowns/itowns2/issues/211","number":211,"state":"open","locked":false,"title":"Net refacto","user":{"login":"autra","id":1576598,"avatar_url":"https://avatars.githubusercontent.com/u/1576598?v=3","gravatar_id":"","url":"https://api.github.com/users/autra","html_url":"https://github.com/autra","followers_url":"https://api.github.com/users/autra/followers","following_url":"https://api.github.com/users/autra/following{/other_user}","gists_url":"https://api.github.com/users/autra/gists{/gist_id}","starred_url":"https://api.github.com/users/autra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autra/subscriptions","organizations_url":"https://api.github.com/users/autra/orgs","repos_url":"https://api.github.com/users/autra/repos","events_url":"https://api.github.com/users/autra/events{/privacy}","received_events_url":"https://api.github.com/users/autra/received_events","type":"User","site_admin":false},"body":"Some simplifications of the network layer. I'm wondering if my Fetcher.js should go in another directory (for example `src/Core/Web`) ?","created_at":"2016-11-18T15:25:22Z","updated_at":"2016-11-18T15:45:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ab98d6e9dabde27b883194de4a55deb7a9e71b8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/iTowns/itowns2/pulls/211/commits","review_comments_url":"https://api.github.com/repos/iTowns/itowns2/pulls/211/comments","review_comment_url":"https://api.github.com/repos/iTowns/itowns2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iTowns/itowns2/issues/211/comments","statuses_url":"https://api.github.com/repos/iTowns/itowns2/statuses/d6763a7c838c159f129b14e940e3f74b9cba55f4","head":{"label":"autra:net_refacto","ref":"net_refacto","sha":"d6763a7c838c159f129b14e940e3f74b9cba55f4","user":{"login":"autra","id":1576598,"avatar_url":"https://avatars.githubusercontent.com/u/1576598?v=3","gravatar_id":"","url":"https://api.github.com/users/autra","html_url":"https://github.com/autra","followers_url":"https://api.github.com/users/autra/followers","following_url":"https://api.github.com/users/autra/following{/other_user}","gists_url":"https://api.github.com/users/autra/gists{/gist_id}","starred_url":"https://api.github.com/users/autra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autra/subscriptions","organizations_url":"https://api.github.com/users/autra/orgs","repos_url":"https://api.github.com/users/autra/repos","events_url":"https://api.github.com/users/autra/events{/privacy}","received_events_url":"https://api.github.com/users/autra/received_events","type":"User","site_admin":false},"repo":{"id":73936715,"name":"itowns2","full_name":"autra/itowns2","owner":{"login":"autra","id":1576598,"avatar_url":"https://avatars.githubusercontent.com/u/1576598?v=3","gravatar_id":"","url":"https://api.github.com/users/autra","html_url":"https://github.com/autra","followers_url":"https://api.github.com/users/autra/followers","following_url":"https://api.github.com/users/autra/following{/other_user}","gists_url":"https://api.github.com/users/autra/gists{/gist_id}","starred_url":"https://api.github.com/users/autra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autra/subscriptions","organizations_url":"https://api.github.com/users/autra/orgs","repos_url":"https://api.github.com/users/autra/repos","events_url":"https://api.github.com/users/autra/events{/privacy}","received_events_url":"https://api.github.com/users/autra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/autra/itowns2","description":"iTowns 2 is the next generation of iTowns, a JS/WebGL framework for 3D geospatial data visualization","fork":true,"url":"https://api.github.com/repos/autra/itowns2","forks_url":"https://api.github.com/repos/autra/itowns2/forks","keys_url":"https://api.github.com/repos/autra/itowns2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autra/itowns2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autra/itowns2/teams","hooks_url":"https://api.github.com/repos/autra/itowns2/hooks","issue_events_url":"https://api.github.com/repos/autra/itowns2/issues/events{/number}","events_url":"https://api.github.com/repos/autra/itowns2/events","assignees_url":"https://api.github.com/repos/autra/itowns2/assignees{/user}","branches_url":"https://api.github.com/repos/autra/itowns2/branches{/branch}","tags_url":"https://api.github.com/repos/autra/itowns2/tags","blobs_url":"https://api.github.com/repos/autra/itowns2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autra/itowns2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autra/itowns2/git/refs{/sha}","trees_url":"https://api.github.com/repos/autra/itowns2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autra/itowns2/statuses/{sha}","languages_url":"https://api.github.com/repos/autra/itowns2/languages","stargazers_url":"https://api.github.com/repos/autra/itowns2/stargazers","contributors_url":"https://api.github.com/repos/autra/itowns2/contributors","subscribers_url":"https://api.github.com/repos/autra/itowns2/subscribers","subscription_url":"https://api.github.com/repos/autra/itowns2/subscription","commits_url":"https://api.github.com/repos/autra/itowns2/commits{/sha}","git_commits_url":"https://api.github.com/repos/autra/itowns2/git/commits{/sha}","comments_url":"https://api.github.com/repos/autra/itowns2/comments{/number}","issue_comment_url":"https://api.github.com/repos/autra/itowns2/issues/comments{/number}","contents_url":"https://api.github.com/repos/autra/itowns2/contents/{+path}","compare_url":"https://api.github.com/repos/autra/itowns2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autra/itowns2/merges","archive_url":"https://api.github.com/repos/autra/itowns2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autra/itowns2/downloads","issues_url":"https://api.github.com/repos/autra/itowns2/issues{/number}","pulls_url":"https://api.github.com/repos/autra/itowns2/pulls{/number}","milestones_url":"https://api.github.com/repos/autra/itowns2/milestones{/number}","notifications_url":"https://api.github.com/repos/autra/itowns2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autra/itowns2/labels{/name}","releases_url":"https://api.github.com/repos/autra/itowns2/releases{/id}","deployments_url":"https://api.github.com/repos/autra/itowns2/deployments","created_at":"2016-11-16T16:05:45Z","updated_at":"2016-11-16T16:05:46Z","pushed_at":"2016-11-18T15:22:00Z","git_url":"git://github.com/autra/itowns2.git","ssh_url":"git@github.com:autra/itowns2.git","clone_url":"https://github.com/autra/itowns2.git","svn_url":"https://github.com/autra/itowns2","homepage":"","size":68210,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"iTowns:master","ref":"master","sha":"2d21d01eae22f213cc8bacb6b7bdef5d5d0518c5","user":{"login":"iTowns","id":14266889,"avatar_url":"https://avatars.githubusercontent.com/u/14266889?v=3","gravatar_id":"","url":"https://api.github.com/users/iTowns","html_url":"https://github.com/iTowns","followers_url":"https://api.github.com/users/iTowns/followers","following_url":"https://api.github.com/users/iTowns/following{/other_user}","gists_url":"https://api.github.com/users/iTowns/gists{/gist_id}","starred_url":"https://api.github.com/users/iTowns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iTowns/subscriptions","organizations_url":"https://api.github.com/users/iTowns/orgs","repos_url":"https://api.github.com/users/iTowns/repos","events_url":"https://api.github.com/users/iTowns/events{/privacy}","received_events_url":"https://api.github.com/users/iTowns/received_events","type":"Organization","site_admin":false},"repo":{"id":43068275,"name":"itowns2","full_name":"iTowns/itowns2","owner":{"login":"iTowns","id":14266889,"avatar_url":"https://avatars.githubusercontent.com/u/14266889?v=3","gravatar_id":"","url":"https://api.github.com/users/iTowns","html_url":"https://github.com/iTowns","followers_url":"https://api.github.com/users/iTowns/followers","following_url":"https://api.github.com/users/iTowns/following{/other_user}","gists_url":"https://api.github.com/users/iTowns/gists{/gist_id}","starred_url":"https://api.github.com/users/iTowns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iTowns/subscriptions","organizations_url":"https://api.github.com/users/iTowns/orgs","repos_url":"https://api.github.com/users/iTowns/repos","events_url":"https://api.github.com/users/iTowns/events{/privacy}","received_events_url":"https://api.github.com/users/iTowns/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iTowns/itowns2","description":"iTowns 2 is the next generation of iTowns, a JS/WebGL framework for 3D geospatial data visualization","fork":false,"url":"https://api.github.com/repos/iTowns/itowns2","forks_url":"https://api.github.com/repos/iTowns/itowns2/forks","keys_url":"https://api.github.com/repos/iTowns/itowns2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iTowns/itowns2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iTowns/itowns2/teams","hooks_url":"https://api.github.com/repos/iTowns/itowns2/hooks","issue_events_url":"https://api.github.com/repos/iTowns/itowns2/issues/events{/number}","events_url":"https://api.github.com/repos/iTowns/itowns2/events","assignees_url":"https://api.github.com/repos/iTowns/itowns2/assignees{/user}","branches_url":"https://api.github.com/repos/iTowns/itowns2/branches{/branch}","tags_url":"https://api.github.com/repos/iTowns/itowns2/tags","blobs_url":"https://api.github.com/repos/iTowns/itowns2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iTowns/itowns2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iTowns/itowns2/git/refs{/sha}","trees_url":"https://api.github.com/repos/iTowns/itowns2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iTowns/itowns2/statuses/{sha}","languages_url":"https://api.github.com/repos/iTowns/itowns2/languages","stargazers_url":"https://api.github.com/repos/iTowns/itowns2/stargazers","contributors_url":"https://api.github.com/repos/iTowns/itowns2/contributors","subscribers_url":"https://api.github.com/repos/iTowns/itowns2/subscribers","subscription_url":"https://api.github.com/repos/iTowns/itowns2/subscription","commits_url":"https://api.github.com/repos/iTowns/itowns2/commits{/sha}","git_commits_url":"https://api.github.com/repos/iTowns/itowns2/git/commits{/sha}","comments_url":"https://api.github.com/repos/iTowns/itowns2/comments{/number}","issue_comment_url":"https://api.github.com/repos/iTowns/itowns2/issues/comments{/number}","contents_url":"https://api.github.com/repos/iTowns/itowns2/contents/{+path}","compare_url":"https://api.github.com/repos/iTowns/itowns2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iTowns/itowns2/merges","archive_url":"https://api.github.com/repos/iTowns/itowns2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iTowns/itowns2/downloads","issues_url":"https://api.github.com/repos/iTowns/itowns2/issues{/number}","pulls_url":"https://api.github.com/repos/iTowns/itowns2/pulls{/number}","milestones_url":"https://api.github.com/repos/iTowns/itowns2/milestones{/number}","notifications_url":"https://api.github.com/repos/iTowns/itowns2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iTowns/itowns2/labels{/name}","releases_url":"https://api.github.com/repos/iTowns/itowns2/releases{/id}","deployments_url":"https://api.github.com/repos/iTowns/itowns2/deployments","created_at":"2015-09-24T13:24:26Z","updated_at":"2016-10-25T15:07:13Z","pushed_at":"2016-11-18T15:25:22Z","git_url":"git://github.com/iTowns/itowns2.git","ssh_url":"git@github.com:iTowns/itowns2.git","clone_url":"https://github.com/iTowns/itowns2.git","svn_url":"https://github.com/iTowns/itowns2","homepage":"","size":69646,"stargazers_count":20,"watchers_count":20,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":74,"forks":16,"open_issues":74,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/211"},"html":{"href":"https://github.com/iTowns/itowns2/pull/211"},"issue":{"href":"https://api.github.com/repos/iTowns/itowns2/issues/211"},"comments":{"href":"https://api.github.com/repos/iTowns/itowns2/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/iTowns/itowns2/statuses/d6763a7c838c159f129b14e940e3f74b9cba55f4"}}}}
{"actor":{"display_login":"tbroyer"}}