{"action":"created","comment":{"url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/comments/153047458","pull_request_review_id":79004621,"id":153047458,"diff_hunk":"@@ -0,0 +1,84 @@\n+@file:Suppress(\"UnsafeCastFromDynamic\")\n+\n+package example\n+\n+/**\n+ * An example to show how to leverage axios lib to fetch remote data by Scott_Huang@qq.com (Zhiliang.Huang@gmail.com)\n+ *\n+ * Date: Nov 25, 2017\n+ */\n+\n+import kotlinext.js.js\n+\n+import kotlinx.html.*\n+import kotlinx.html.js.*\n+import org.w3c.dom.HTMLInputElement\n+import react.*\n+import react.dom.*\n+\n+data class ZipResult(val country: String, val state: String, val city: String)\n+interface AxiosProps : RProps {\n+}\n+\n+interface AxiosState : RState {\n+    var zipCode: String\n+    var zipResult: ZipResult\n+}\n+\n+//Per Hypnosphi advice, change to common js way.\n+//you should need \"npm install axios --save\" in advance in your project folder\n+@JsModule(\"axios\")\n+external fun axios(config: dynamic): dynamic\n+\n+\n+class AxiosSearch(props: AxiosProps) : RComponent<AxiosProps, AxiosState>(props) {\n+    override fun AxiosState.init(props: AxiosProps) {\n+        zipCode = \"\" \n+        zipResult = ZipResult(\"\", \"\", \"\")\n+    }\n+\n+    override fun RBuilder.render() {\n+        val infoText = \"Input USA 5 digit zip code below... such as 90210 or 24124 or any valid zip code.\"\n+        div {\n+            p { +infoText }\n+            input(type = InputType.text, name = \"zipCode\") {\n+                key = \"zipCode\"\n+                attrs {\n+                    value = state.zipCode\n+                    placeholder = \"Input zip code ...\"\n+                    title = infoText\n+                    onChangeFunction = {","path":"examples/src/main/kotlin/example/AxiosSearch.kt","position":50,"original_position":50,"commit_id":"266824970109458947ba4ec2326b9be9c3c69bbf","original_commit_id":"266824970109458947ba4ec2326b9be9c3c69bbf","user":{"login":"Hypnosphi","id":6651625,"avatar_url":"https://avatars3.githubusercontent.com/u/6651625?v=4","gravatar_id":"","url":"https://api.github.com/users/Hypnosphi","html_url":"https://github.com/Hypnosphi","followers_url":"https://api.github.com/users/Hypnosphi/followers","following_url":"https://api.github.com/users/Hypnosphi/following{/other_user}","gists_url":"https://api.github.com/users/Hypnosphi/gists{/gist_id}","starred_url":"https://api.github.com/users/Hypnosphi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hypnosphi/subscriptions","organizations_url":"https://api.github.com/users/Hypnosphi/orgs","repos_url":"https://api.github.com/users/Hypnosphi/repos","events_url":"https://api.github.com/users/Hypnosphi/events{/privacy}","received_events_url":"https://api.github.com/users/Hypnosphi/received_events","type":"User","site_admin":false},"body":"Let's extract it into a component method","created_at":"2017-11-25T14:52:30Z","updated_at":"2017-11-25T14:52:30Z","html_url":"https://github.com/JetBrains/kotlin-wrappers/pull/23#discussion_r153047458","pull_request_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/comments/153047458"},"html":{"href":"https://github.com/JetBrains/kotlin-wrappers/pull/23#discussion_r153047458"},"pull_request":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23","id":154638199,"html_url":"https://github.com/JetBrains/kotlin-wrappers/pull/23","diff_url":"https://github.com/JetBrains/kotlin-wrappers/pull/23.diff","patch_url":"https://github.com/JetBrains/kotlin-wrappers/pull/23.patch","issue_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues/23","number":23,"state":"open","locked":false,"title":"Create AxiosSearch.kt","user":{"login":"ScottHuangZL","id":8861324,"avatar_url":"https://avatars0.githubusercontent.com/u/8861324?v=4","gravatar_id":"","url":"https://api.github.com/users/ScottHuangZL","html_url":"https://github.com/ScottHuangZL","followers_url":"https://api.github.com/users/ScottHuangZL/followers","following_url":"https://api.github.com/users/ScottHuangZL/following{/other_user}","gists_url":"https://api.github.com/users/ScottHuangZL/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottHuangZL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottHuangZL/subscriptions","organizations_url":"https://api.github.com/users/ScottHuangZL/orgs","repos_url":"https://api.github.com/users/ScottHuangZL/repos","events_url":"https://api.github.com/users/ScottHuangZL/events{/privacy}","received_events_url":"https://api.github.com/users/ScottHuangZL/received_events","type":"User","site_admin":false},"body":" An example to show how to leverage **axios** lib to fetch remote data by Scott_Huang@qq.com (Zhiliang.Huang@gmail.com)\r\n(Btw, Vue.js formally leverage axios for ajax related works, so it should be good if React.js also use it)\r\n \r\n\r\nIt will be helpful for people to use axios lib to make their static data web to live/real data web, thanks.\r\n\r\n Date: Nov 25, 2017\r\n ","created_at":"2017-11-25T13:36:48Z","updated_at":"2017-11-25T14:52:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ae337a1a54060978f6f5b9386980bff19bc8bcc","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23/commits","review_comments_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23/comments","review_comment_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues/23/comments","statuses_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/statuses/266824970109458947ba4ec2326b9be9c3c69bbf","head":{"label":"ScottHuangZL:patch-5","ref":"patch-5","sha":"266824970109458947ba4ec2326b9be9c3c69bbf","user":{"login":"ScottHuangZL","id":8861324,"avatar_url":"https://avatars0.githubusercontent.com/u/8861324?v=4","gravatar_id":"","url":"https://api.github.com/users/ScottHuangZL","html_url":"https://github.com/ScottHuangZL","followers_url":"https://api.github.com/users/ScottHuangZL/followers","following_url":"https://api.github.com/users/ScottHuangZL/following{/other_user}","gists_url":"https://api.github.com/users/ScottHuangZL/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottHuangZL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottHuangZL/subscriptions","organizations_url":"https://api.github.com/users/ScottHuangZL/orgs","repos_url":"https://api.github.com/users/ScottHuangZL/repos","events_url":"https://api.github.com/users/ScottHuangZL/events{/privacy}","received_events_url":"https://api.github.com/users/ScottHuangZL/received_events","type":"User","site_admin":false},"repo":{"id":111423643,"name":"kotlin-wrappers","full_name":"ScottHuangZL/kotlin-wrappers","owner":{"login":"ScottHuangZL","id":8861324,"avatar_url":"https://avatars0.githubusercontent.com/u/8861324?v=4","gravatar_id":"","url":"https://api.github.com/users/ScottHuangZL","html_url":"https://github.com/ScottHuangZL","followers_url":"https://api.github.com/users/ScottHuangZL/followers","following_url":"https://api.github.com/users/ScottHuangZL/following{/other_user}","gists_url":"https://api.github.com/users/ScottHuangZL/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottHuangZL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottHuangZL/subscriptions","organizations_url":"https://api.github.com/users/ScottHuangZL/orgs","repos_url":"https://api.github.com/users/ScottHuangZL/repos","events_url":"https://api.github.com/users/ScottHuangZL/events{/privacy}","received_events_url":"https://api.github.com/users/ScottHuangZL/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ScottHuangZL/kotlin-wrappers","description":"Kotlin wrappers for popular JavaScript libraries","fork":true,"url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers","forks_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/forks","keys_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/teams","hooks_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/hooks","issue_events_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/issues/events{/number}","events_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/events","assignees_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/assignees{/user}","branches_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/branches{/branch}","tags_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/tags","blobs_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/languages","stargazers_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/stargazers","contributors_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/contributors","subscribers_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/subscribers","subscription_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/subscription","commits_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/contents/{+path}","compare_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/merges","archive_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/downloads","issues_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/issues{/number}","pulls_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/labels{/name}","releases_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/releases{/id}","deployments_url":"https://api.github.com/repos/ScottHuangZL/kotlin-wrappers/deployments","created_at":"2017-11-20T14:53:46Z","updated_at":"2017-11-20T14:53:48Z","pushed_at":"2017-11-25T14:46:08Z","git_url":"git://github.com/ScottHuangZL/kotlin-wrappers.git","ssh_url":"git@github.com:ScottHuangZL/kotlin-wrappers.git","clone_url":"https://github.com/ScottHuangZL/kotlin-wrappers.git","svn_url":"https://github.com/ScottHuangZL/kotlin-wrappers","homepage":"","size":134,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JetBrains:master","ref":"master","sha":"4bf06e7ea708f6c8943f721793a0f116847e78d2","user":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars2.githubusercontent.com/u/878437?v=4","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"repo":{"id":93250841,"name":"kotlin-wrappers","full_name":"JetBrains/kotlin-wrappers","owner":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars2.githubusercontent.com/u/878437?v=4","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JetBrains/kotlin-wrappers","description":"Kotlin wrappers for popular JavaScript libraries","fork":false,"url":"https://api.github.com/repos/JetBrains/kotlin-wrappers","forks_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/forks","keys_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/teams","hooks_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/hooks","issue_events_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues/events{/number}","events_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/events","assignees_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/assignees{/user}","branches_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/branches{/branch}","tags_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/tags","blobs_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/git/refs{/sha}","trees_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/statuses/{sha}","languages_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/languages","stargazers_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/stargazers","contributors_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/contributors","subscribers_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/subscribers","subscription_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/subscription","commits_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/commits{/sha}","git_commits_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/git/commits{/sha}","comments_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/comments{/number}","issue_comment_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues/comments{/number}","contents_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/contents/{+path}","compare_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/merges","archive_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/downloads","issues_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues{/number}","pulls_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls{/number}","milestones_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/milestones{/number}","notifications_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/labels{/name}","releases_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/releases{/id}","deployments_url":"https://api.github.com/repos/JetBrains/kotlin-wrappers/deployments","created_at":"2017-06-03T13:46:54Z","updated_at":"2017-11-23T16:58:03Z","pushed_at":"2017-11-25T14:46:08Z","git_url":"git://github.com/JetBrains/kotlin-wrappers.git","ssh_url":"git@github.com:JetBrains/kotlin-wrappers.git","clone_url":"https://github.com/JetBrains/kotlin-wrappers.git","svn_url":"https://github.com/JetBrains/kotlin-wrappers","homepage":"","size":124,"stargazers_count":72,"watchers_count":72,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":7,"forks":5,"open_issues":7,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23"},"html":{"href":"https://github.com/JetBrains/kotlin-wrappers/pull/23"},"issue":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues/23"},"comments":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/JetBrains/kotlin-wrappers/statuses/266824970109458947ba4ec2326b9be9c3c69bbf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Hypnosphi"}}