{"action":"created","comment":{"url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments/223779441","pull_request_review_id":162990208,"id":223779441,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzc3OTQ0MQ==","diff_hunk":"@@ -0,0 +1,166 @@\n+import * as React from 'react';\n+\n+interface IAsAsyncState<TProps> {\n+  component?: React.ComponentType<TProps> | undefined;\n+  error?: Error;\n+  placeholder?: JSX.Element;\n+  onLoad?: () => void;\n+  onError?: (error: Error) => void;\n+}\n+\n+/**\n+ * If possible, use a WeakMap to maintain a cache of loaded components.\n+ * This can be used to synchronously render components that have already been loaded,\n+ * rather than having to wait for at least one async tick.\n+ */\n+const syncModuleCache =\n+  typeof WeakMap !== 'undefined'\n+    ? new WeakMap<() => Promise<any>, React.ComponentType<any>>() // tslint:disable-line:no-any\n+    : undefined;\n+\n+/**\n+ * Represents the surface of a module which has a default export.\n+ */\n+export interface IModuleWithDefault<T> {\n+  default: T;\n+}\n+\n+export interface IAsAsyncProps {\n+  /**\n+   * A placeholder to render while the component loads.\n+   */\n+  placeholder?: JSX.Element;\n+  /**\n+   * A callback to be invoked when the component has loaded and rendered.\n+   */\n+  onLoad?: () => void;\n+  /**\n+   * A callback to be invoked when the component has failed to load.\n+   */\n+  onError?: (error: Error) => void;\n+}\n+\n+/**\n+ * Produces a component which internally loads the target component before first mount.\n+ * The component passes all props through to the loaded component.\n+ *\n+ * This overload accepts a module with a default export for the component.\n+ */\n+export function asAsync<TProps, TOwnProps = IAsAsyncProps>(\n+  load: () => Promise<{ default: React.ComponentType<TProps> }>,","path":"packages/utilities/src/asAsync.tsx","position":50,"original_position":50,"commit_id":"90b75279f8cf81b5a8b40c01ae4c3921009c292b","original_commit_id":"90b75279f8cf81b5a8b40c01ae4c3921009c292b","user":{"login":"dzearing","id":1110944,"node_id":"MDQ6VXNlcjExMTA5NDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1110944?v=4","gravatar_id":"","url":"https://api.github.com/users/dzearing","html_url":"https://github.com/dzearing","followers_url":"https://api.github.com/users/dzearing/followers","following_url":"https://api.github.com/users/dzearing/following{/other_user}","gists_url":"https://api.github.com/users/dzearing/gists{/gist_id}","starred_url":"https://api.github.com/users/dzearing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzearing/subscriptions","organizations_url":"https://api.github.com/users/dzearing/orgs","repos_url":"https://api.github.com/users/dzearing/repos","events_url":"https://api.github.com/users/dzearing/events{/privacy}","received_events_url":"https://api.github.com/users/dzearing/received_events","type":"User","site_admin":false},"body":"assuming the import has a default export is a bad assumption. Instead, could we just have an exportName prop that defaults to `default` and we pull that out of the object?","created_at":"2018-10-09T16:46:20Z","updated_at":"2018-10-09T16:46:21Z","html_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/4154#discussion_r223779441","pull_request_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments/223779441"},"html":{"href":"https://github.com/OfficeDev/office-ui-fabric-react/pull/4154#discussion_r223779441"},"pull_request":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154"}}},"pull_request":{"url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154","id":172375752,"node_id":"MDExOlB1bGxSZXF1ZXN0MTcyMzc1NzUy","html_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/4154","diff_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/4154.diff","patch_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/4154.patch","issue_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/4154","number":4154,"state":"open","locked":false,"title":"Async","user":{"login":"ThomasMichon","id":6828233,"node_id":"MDQ6VXNlcjY4MjgyMzM=","avatar_url":"https://avatars0.githubusercontent.com/u/6828233?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasMichon","html_url":"https://github.com/ThomasMichon","followers_url":"https://api.github.com/users/ThomasMichon/followers","following_url":"https://api.github.com/users/ThomasMichon/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMichon/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMichon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMichon/subscriptions","organizations_url":"https://api.github.com/users/ThomasMichon/orgs","repos_url":"https://api.github.com/users/ThomasMichon/repos","events_url":"https://api.github.com/users/ThomasMichon/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMichon/received_events","type":"User","site_admin":false},"body":"# Overview\r\n\r\nThis change adds an `asAsync` higher-order component to `@uifabric/utilities`. It is currently very bare-bones, serving purely to load and render a component made available via a `Promise` callback.","created_at":"2018-03-01T22:45:54Z","updated_at":"2018-10-09T16:46:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65c4adf6ec737f0079a2832642aefa805f6eb99e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":412708396,"node_id":"MDU6TGFiZWw0MTI3MDgzOTY=","url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/labels/Needs:%20Discussion%20%F0%9F%99%8B","name":"Needs: Discussion 🙋","color":"8c51c3","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154/commits","review_comments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154/comments","review_comment_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/4154/comments","statuses_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/statuses/90b75279f8cf81b5a8b40c01ae4c3921009c292b","head":{"label":"ThomasMichon:async","ref":"async","sha":"90b75279f8cf81b5a8b40c01ae4c3921009c292b","user":{"login":"ThomasMichon","id":6828233,"node_id":"MDQ6VXNlcjY4MjgyMzM=","avatar_url":"https://avatars0.githubusercontent.com/u/6828233?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasMichon","html_url":"https://github.com/ThomasMichon","followers_url":"https://api.github.com/users/ThomasMichon/followers","following_url":"https://api.github.com/users/ThomasMichon/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMichon/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMichon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMichon/subscriptions","organizations_url":"https://api.github.com/users/ThomasMichon/orgs","repos_url":"https://api.github.com/users/ThomasMichon/repos","events_url":"https://api.github.com/users/ThomasMichon/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMichon/received_events","type":"User","site_admin":false},"repo":{"id":63994992,"node_id":"MDEwOlJlcG9zaXRvcnk2Mzk5NDk5Mg==","name":"office-ui-fabric-react","full_name":"ThomasMichon/office-ui-fabric-react","private":false,"owner":{"login":"ThomasMichon","id":6828233,"node_id":"MDQ6VXNlcjY4MjgyMzM=","avatar_url":"https://avatars0.githubusercontent.com/u/6828233?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasMichon","html_url":"https://github.com/ThomasMichon","followers_url":"https://api.github.com/users/ThomasMichon/followers","following_url":"https://api.github.com/users/ThomasMichon/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMichon/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMichon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMichon/subscriptions","organizations_url":"https://api.github.com/users/ThomasMichon/orgs","repos_url":"https://api.github.com/users/ThomasMichon/repos","events_url":"https://api.github.com/users/ThomasMichon/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMichon/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ThomasMichon/office-ui-fabric-react","description":"React components for building experiences for Office and Office 365.","fork":true,"url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react","forks_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/forks","keys_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/teams","hooks_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/hooks","issue_events_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/events","assignees_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/tags","blobs_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/languages","stargazers_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/stargazers","contributors_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/contributors","subscribers_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/subscribers","subscription_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/subscription","commits_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/merges","archive_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/downloads","issues_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/labels{/name}","releases_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/releases{/id}","deployments_url":"https://api.github.com/repos/ThomasMichon/office-ui-fabric-react/deployments","created_at":"2016-07-23T02:26:36Z","updated_at":"2016-07-23T02:26:38Z","pushed_at":"2018-09-12T04:53:50Z","git_url":"git://github.com/ThomasMichon/office-ui-fabric-react.git","ssh_url":"git@github.com:ThomasMichon/office-ui-fabric-react.git","clone_url":"https://github.com/ThomasMichon/office-ui-fabric-react.git","svn_url":"https://github.com/ThomasMichon/office-ui-fabric-react","homepage":"http://dev.office.com/fabric","size":40314,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OfficeDev:master","ref":"master","sha":"491fb1b63c1c8b2554a9e5b5ccf4328e90e919e4","user":{"login":"OfficeDev","id":6789362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3ODkzNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6789362?v=4","gravatar_id":"","url":"https://api.github.com/users/OfficeDev","html_url":"https://github.com/OfficeDev","followers_url":"https://api.github.com/users/OfficeDev/followers","following_url":"https://api.github.com/users/OfficeDev/following{/other_user}","gists_url":"https://api.github.com/users/OfficeDev/gists{/gist_id}","starred_url":"https://api.github.com/users/OfficeDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OfficeDev/subscriptions","organizations_url":"https://api.github.com/users/OfficeDev/orgs","repos_url":"https://api.github.com/users/OfficeDev/repos","events_url":"https://api.github.com/users/OfficeDev/events{/privacy}","received_events_url":"https://api.github.com/users/OfficeDev/received_events","type":"Organization","site_admin":false},"repo":{"id":60537144,"node_id":"MDEwOlJlcG9zaXRvcnk2MDUzNzE0NA==","name":"office-ui-fabric-react","full_name":"OfficeDev/office-ui-fabric-react","private":false,"owner":{"login":"OfficeDev","id":6789362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3ODkzNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6789362?v=4","gravatar_id":"","url":"https://api.github.com/users/OfficeDev","html_url":"https://github.com/OfficeDev","followers_url":"https://api.github.com/users/OfficeDev/followers","following_url":"https://api.github.com/users/OfficeDev/following{/other_user}","gists_url":"https://api.github.com/users/OfficeDev/gists{/gist_id}","starred_url":"https://api.github.com/users/OfficeDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OfficeDev/subscriptions","organizations_url":"https://api.github.com/users/OfficeDev/orgs","repos_url":"https://api.github.com/users/OfficeDev/repos","events_url":"https://api.github.com/users/OfficeDev/events{/privacy}","received_events_url":"https://api.github.com/users/OfficeDev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OfficeDev/office-ui-fabric-react","description":"React components for building experiences for Office and Office 365.","fork":false,"url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react","forks_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/forks","keys_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/teams","hooks_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/hooks","issue_events_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/events{/number}","events_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/events","assignees_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/assignees{/user}","branches_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/branches{/branch}","tags_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/tags","blobs_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/statuses/{sha}","languages_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/languages","stargazers_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/stargazers","contributors_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/contributors","subscribers_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/subscribers","subscription_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/subscription","commits_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/contents/{+path}","compare_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/merges","archive_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/downloads","issues_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues{/number}","pulls_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls{/number}","milestones_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/milestones{/number}","notifications_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/labels{/name}","releases_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/releases{/id}","deployments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/deployments","created_at":"2016-06-06T15:03:44Z","updated_at":"2018-10-09T14:30:11Z","pushed_at":"2018-10-09T16:46:12Z","git_url":"git://github.com/OfficeDev/office-ui-fabric-react.git","ssh_url":"git@github.com:OfficeDev/office-ui-fabric-react.git","clone_url":"https://github.com/OfficeDev/office-ui-fabric-react.git","svn_url":"https://github.com/OfficeDev/office-ui-fabric-react","homepage":"https://developer.microsoft.com/en-us/fabric#/components","size":43532,"stargazers_count":3366,"watchers_count":3366,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":763,"mirror_url":null,"archived":false,"open_issues_count":363,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":763,"open_issues":363,"watchers":3366,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154"},"html":{"href":"https://github.com/OfficeDev/office-ui-fabric-react/pull/4154"},"issue":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/4154"},"comments":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/4154/comments"},"review_comments":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154/comments"},"review_comment":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/4154/commits"},"statuses":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/statuses/90b75279f8cf81b5a8b40c01ae4c3921009c292b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"dzearing"}}