{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/27660340","id":27660340,"diff_hunk":"@@ -0,0 +1,67 @@\n+/**\n+ * Copyright (c) 2015-present, Facebook, Inc.\n+ * All rights reserved.\n+ *\n+ * This source code is licensed under the BSD-style license found in the\n+ * LICENSE file in the root directory of this source tree. An additional grant\n+ * of patent rights can be found in the PATENTS file in the same directory.\n+ *\n+ * @providesModule Viewport\n+ * @flow\n+ */\n+'use strict';\n+\n+var NativeModules = require('NativeModules');\n+var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\n+var RCTDimensionManager = NativeModules.DimensionManager;\n+\n+var logError = require('logError');\n+\n+var DEVICE_DIMENSIONS_EVENT = 'dimensionsDidChange';\n+\n+/**\n+ * ViewPortDimensions class gives access to the viewport's height and width.\n+ *\n+ * This could be used if someone wanted an image which stretched the width of\n+ * the device.\n+ *\n+ * Note: The values returned here are all ready in terms of the pixel ratio of\n+ * the device. For example, the iPhone 6 renders 750x1334 pixels. However, it has\n+ * a pixel ratio of two. Therefore the return values of these functions will\n+ * all ready be modified by the pixel ratio. In the iPhone 6's case this means","path":"Libraries/Utilities/Viewport.js","position":31,"original_position":31,"commit_id":"d7302832d51a9448c695b75558e64519908738fa","original_commit_id":"d7302832d51a9448c695b75558e64519908738fa","user":{"login":"pjjanak","id":1039470,"avatar_url":"https://avatars.githubusercontent.com/u/1039470?v=3","gravatar_id":"","url":"https://api.github.com/users/pjjanak","html_url":"https://github.com/pjjanak","followers_url":"https://api.github.com/users/pjjanak/followers","following_url":"https://api.github.com/users/pjjanak/following{/other_user}","gists_url":"https://api.github.com/users/pjjanak/gists{/gist_id}","starred_url":"https://api.github.com/users/pjjanak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjjanak/subscriptions","organizations_url":"https://api.github.com/users/pjjanak/orgs","repos_url":"https://api.github.com/users/pjjanak/repos","events_url":"https://api.github.com/users/pjjanak/events{/privacy}","received_events_url":"https://api.github.com/users/pjjanak/received_events","type":"User","site_admin":false},"body":"I'll change, but 'all ready' is a real thing! 'already' is just a bastardization! haha","created_at":"2015-04-02T14:14:55Z","updated_at":"2015-04-02T14:14:55Z","html_url":"https://github.com/facebook/react-native/pull/418#discussion_r27660340","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/418","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/27660340"},"html":{"href":"https://github.com/facebook/react-native/pull/418#discussion_r27660340"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/418"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/418","id":32173211,"html_url":"https://github.com/facebook/react-native/pull/418","diff_url":"https://github.com/facebook/react-native/pull/418.diff","patch_url":"https://github.com/facebook/react-native/pull/418.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/418","number":418,"state":"open","locked":false,"title":"Add utility to get viewport dimensions","user":{"login":"pjjanak","id":1039470,"avatar_url":"https://avatars.githubusercontent.com/u/1039470?v=3","gravatar_id":"","url":"https://api.github.com/users/pjjanak","html_url":"https://github.com/pjjanak","followers_url":"https://api.github.com/users/pjjanak/followers","following_url":"https://api.github.com/users/pjjanak/following{/other_user}","gists_url":"https://api.github.com/users/pjjanak/gists{/gist_id}","starred_url":"https://api.github.com/users/pjjanak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjjanak/subscriptions","organizations_url":"https://api.github.com/users/pjjanak/orgs","repos_url":"https://api.github.com/users/pjjanak/repos","events_url":"https://api.github.com/users/pjjanak/events{/privacy}","received_events_url":"https://api.github.com/users/pjjanak/received_events","type":"User","site_admin":false},"body":"Basing this off of how `PixelRatio` works. Just forwards to `Dimensions` and requests the other two properties that have been exposed on `Dimensions.window`. Also set documentation to on.","created_at":"2015-03-28T23:21:32Z","updated_at":"2015-04-02T14:14:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9332240112e607c7ca23b1b6c5942f5f4d5a769c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/418/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/418/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/418/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/d7302832d51a9448c695b75558e64519908738fa","head":{"label":"pjjanak:viewPortDimensions","ref":"viewPortDimensions","sha":"d7302832d51a9448c695b75558e64519908738fa","user":{"login":"pjjanak","id":1039470,"avatar_url":"https://avatars.githubusercontent.com/u/1039470?v=3","gravatar_id":"","url":"https://api.github.com/users/pjjanak","html_url":"https://github.com/pjjanak","followers_url":"https://api.github.com/users/pjjanak/followers","following_url":"https://api.github.com/users/pjjanak/following{/other_user}","gists_url":"https://api.github.com/users/pjjanak/gists{/gist_id}","starred_url":"https://api.github.com/users/pjjanak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjjanak/subscriptions","organizations_url":"https://api.github.com/users/pjjanak/orgs","repos_url":"https://api.github.com/users/pjjanak/repos","events_url":"https://api.github.com/users/pjjanak/events{/privacy}","received_events_url":"https://api.github.com/users/pjjanak/received_events","type":"User","site_admin":false},"repo":{"id":32996112,"name":"react-native","full_name":"pjjanak/react-native","owner":{"login":"pjjanak","id":1039470,"avatar_url":"https://avatars.githubusercontent.com/u/1039470?v=3","gravatar_id":"","url":"https://api.github.com/users/pjjanak","html_url":"https://github.com/pjjanak","followers_url":"https://api.github.com/users/pjjanak/followers","following_url":"https://api.github.com/users/pjjanak/following{/other_user}","gists_url":"https://api.github.com/users/pjjanak/gists{/gist_id}","starred_url":"https://api.github.com/users/pjjanak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjjanak/subscriptions","organizations_url":"https://api.github.com/users/pjjanak/orgs","repos_url":"https://api.github.com/users/pjjanak/repos","events_url":"https://api.github.com/users/pjjanak/events{/privacy}","received_events_url":"https://api.github.com/users/pjjanak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pjjanak/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/pjjanak/react-native","forks_url":"https://api.github.com/repos/pjjanak/react-native/forks","keys_url":"https://api.github.com/repos/pjjanak/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pjjanak/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pjjanak/react-native/teams","hooks_url":"https://api.github.com/repos/pjjanak/react-native/hooks","issue_events_url":"https://api.github.com/repos/pjjanak/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/pjjanak/react-native/events","assignees_url":"https://api.github.com/repos/pjjanak/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/pjjanak/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/pjjanak/react-native/tags","blobs_url":"https://api.github.com/repos/pjjanak/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pjjanak/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pjjanak/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/pjjanak/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pjjanak/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/pjjanak/react-native/languages","stargazers_url":"https://api.github.com/repos/pjjanak/react-native/stargazers","contributors_url":"https://api.github.com/repos/pjjanak/react-native/contributors","subscribers_url":"https://api.github.com/repos/pjjanak/react-native/subscribers","subscription_url":"https://api.github.com/repos/pjjanak/react-native/subscription","commits_url":"https://api.github.com/repos/pjjanak/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/pjjanak/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/pjjanak/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/pjjanak/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/pjjanak/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/pjjanak/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pjjanak/react-native/merges","archive_url":"https://api.github.com/repos/pjjanak/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pjjanak/react-native/downloads","issues_url":"https://api.github.com/repos/pjjanak/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/pjjanak/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/pjjanak/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/pjjanak/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pjjanak/react-native/labels{/name}","releases_url":"https://api.github.com/repos/pjjanak/react-native/releases{/id}","created_at":"2015-03-27T16:09:44Z","updated_at":"2015-03-27T23:40:29Z","pushed_at":"2015-04-01T16:18:46Z","git_url":"git://github.com/pjjanak/react-native.git","ssh_url":"git@github.com:pjjanak/react-native.git","clone_url":"https://github.com/pjjanak/react-native.git","svn_url":"https://github.com/pjjanak/react-native","homepage":"http://facebook.github.io/react-native/","size":6274,"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":"facebook:master","ref":"master","sha":"587b479104551eee8b5db22a955d4e3bcd41c83c","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","created_at":"2015-01-09T18:10:16Z","updated_at":"2015-04-02T14:13:54Z","pushed_at":"2015-04-02T14:02:49Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":22973,"stargazers_count":10850,"watchers_count":10850,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":918,"mirror_url":null,"open_issues_count":236,"forks":918,"open_issues":236,"watchers":10850,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/418"},"html":{"href":"https://github.com/facebook/react-native/pull/418"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/418"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/418/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/418/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/418/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/d7302832d51a9448c695b75558e64519908738fa"}}}}