{"action":"created","comment":{"url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/comments/187638973","pull_request_review_id":119464546,"id":187638973,"diff_hunk":"@@ -28,50 +45,70 @@ public string SearchQuery\n             }\n         }\n \n-        public List<string> Results\n-        {\n-            get\n-            {\n-                return _results;\n-            }\n-            set\n-            {\n-                _results = value;\n-                RaisePropertyChanged(nameof(Results));\n-            }\n-        }\n+        public ObservableCollection<string> Results => _results;\n \n-        public DeliveryClient DeliveryClient { get; set; }\n-        public event PropertyChangedEventHandler PropertyChanged;\n+        #endregion\n+\n+        #region \"Constructors\"\n \n         public DeliveryViewModel()\n         {\n-            DeliveryClient = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n+            Results.CollectionChanged += Results_CollectionChanged;\n \n+            // Since Rx is \"late to the party\" in the .NET ecosystem, Observables are created from traditional .NET events.\n+            // Although there still has to be an event created, the advantage of Rx is in that there is just one subscriber to the event that has to be maintained--the Observable.\n+            // The Select operator extracts the query.\n+            // The DistinctUntilChanged operator guarantees that only unique search phrases are passed around.\n+            // The Throttle operator buffers the user keystrokes for one second before they become visible to the client code.\n             var searchQueryObservable = Observable.FromEventPattern<PropertyChangedEventArgs>(this, nameof(PropertyChanged))\n                 .Select(e => ((DeliveryViewModel)e.Sender).SearchQuery)\n                 .DistinctUntilChanged()\n                 .Throttle(TimeSpan.FromSeconds(1));\n \n-            // Option 1: Directly populate the Results via an ordinary async/await call to DeliveryClient.\n-            //var searchQuerySubscription = searchQueryObservable.Subscribe(async searchQuery => Results = (await DeliveryClient.GetItemsAsync<Article>(new ContainsFilter(\"elements.persona\", searchQuery))).Items.Select(i => i.Title).ToList());\n+            // Clear the Results upon each (distinct and throttled) keystroke in the text box. Make sure the observer code executes in the UI thread via the ObserveOn method.\n+            searchQueryObservable\n+                .ObserveOn(SynchronizationContext.Current)","path":"uwp-rx/DeliveryViewModel.cs","position":82,"original_position":82,"commit_id":"1b8ba03ea0969cd532b371de18ca8ecd95e9ce9b","original_commit_id":"1b8ba03ea0969cd532b371de18ca8ecd95e9ce9b","user":{"login":"JanLenoch","id":17413329,"avatar_url":"https://avatars1.githubusercontent.com/u/17413329?v=4","gravatar_id":"","url":"https://api.github.com/users/JanLenoch","html_url":"https://github.com/JanLenoch","followers_url":"https://api.github.com/users/JanLenoch/followers","following_url":"https://api.github.com/users/JanLenoch/following{/other_user}","gists_url":"https://api.github.com/users/JanLenoch/gists{/gist_id}","starred_url":"https://api.github.com/users/JanLenoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanLenoch/subscriptions","organizations_url":"https://api.github.com/users/JanLenoch/orgs","repos_url":"https://api.github.com/users/JanLenoch/repos","events_url":"https://api.github.com/users/JanLenoch/events{/privacy}","received_events_url":"https://api.github.com/users/JanLenoch/received_events","type":"User","site_admin":false},"body":"dtto","created_at":"2018-05-11T14:53:44Z","updated_at":"2018-05-11T14:53:44Z","html_url":"https://github.com/Kentico/cloud-articles-examples/pull/2#discussion_r187638973","pull_request_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/comments/187638973"},"html":{"href":"https://github.com/Kentico/cloud-articles-examples/pull/2#discussion_r187638973"},"pull_request":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2"}},"in_reply_to_id":184955960},"pull_request":{"url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2","id":183989768,"html_url":"https://github.com/Kentico/cloud-articles-examples/pull/2","diff_url":"https://github.com/Kentico/cloud-articles-examples/pull/2.diff","patch_url":"https://github.com/Kentico/cloud-articles-examples/pull/2.patch","issue_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/2","number":2,"state":"open","locked":false,"title":"Rx","user":{"login":"JanLenoch","id":17413329,"avatar_url":"https://avatars1.githubusercontent.com/u/17413329?v=4","gravatar_id":"","url":"https://api.github.com/users/JanLenoch","html_url":"https://github.com/JanLenoch","followers_url":"https://api.github.com/users/JanLenoch/followers","following_url":"https://api.github.com/users/JanLenoch/following{/other_user}","gists_url":"https://api.github.com/users/JanLenoch/gists{/gist_id}","starred_url":"https://api.github.com/users/JanLenoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanLenoch/subscriptions","organizations_url":"https://api.github.com/users/JanLenoch/orgs","repos_url":"https://api.github.com/users/JanLenoch/repos","events_url":"https://api.github.com/users/JanLenoch/events{/privacy}","received_events_url":"https://api.github.com/users/JanLenoch/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-25T10:27:29Z","updated_at":"2018-05-11T14:53:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c38beefb4e2e8f9c3ad3112980499ff350102601","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":745530943,"url":"https://api.github.com/repos/Kentico/cloud-articles-examples/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/2/comments","statuses_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/statuses/1b8ba03ea0969cd532b371de18ca8ecd95e9ce9b","head":{"label":"Kentico:rx","ref":"rx","sha":"1b8ba03ea0969cd532b371de18ca8ecd95e9ce9b","user":{"login":"Kentico","id":8819690,"avatar_url":"https://avatars0.githubusercontent.com/u/8819690?v=4","gravatar_id":"","url":"https://api.github.com/users/Kentico","html_url":"https://github.com/Kentico","followers_url":"https://api.github.com/users/Kentico/followers","following_url":"https://api.github.com/users/Kentico/following{/other_user}","gists_url":"https://api.github.com/users/Kentico/gists{/gist_id}","starred_url":"https://api.github.com/users/Kentico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kentico/subscriptions","organizations_url":"https://api.github.com/users/Kentico/orgs","repos_url":"https://api.github.com/users/Kentico/repos","events_url":"https://api.github.com/users/Kentico/events{/privacy}","received_events_url":"https://api.github.com/users/Kentico/received_events","type":"Organization","site_admin":false},"repo":{"id":110127725,"name":"cloud-articles-examples","full_name":"Kentico/cloud-articles-examples","owner":{"login":"Kentico","id":8819690,"avatar_url":"https://avatars0.githubusercontent.com/u/8819690?v=4","gravatar_id":"","url":"https://api.github.com/users/Kentico","html_url":"https://github.com/Kentico","followers_url":"https://api.github.com/users/Kentico/followers","following_url":"https://api.github.com/users/Kentico/following{/other_user}","gists_url":"https://api.github.com/users/Kentico/gists{/gist_id}","starred_url":"https://api.github.com/users/Kentico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kentico/subscriptions","organizations_url":"https://api.github.com/users/Kentico/orgs","repos_url":"https://api.github.com/users/Kentico/repos","events_url":"https://api.github.com/users/Kentico/events{/privacy}","received_events_url":"https://api.github.com/users/Kentico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kentico/cloud-articles-examples","description":"A common repository for code examples used in articles, blog posts, forums, etc.","fork":false,"url":"https://api.github.com/repos/Kentico/cloud-articles-examples","forks_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/forks","keys_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/teams","hooks_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/hooks","issue_events_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/events{/number}","events_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/events","assignees_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/assignees{/user}","branches_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/branches{/branch}","tags_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/tags","blobs_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/statuses/{sha}","languages_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/languages","stargazers_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/stargazers","contributors_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/contributors","subscribers_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/subscribers","subscription_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/subscription","commits_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/contents/{+path}","compare_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/merges","archive_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/downloads","issues_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues{/number}","pulls_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls{/number}","milestones_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/milestones{/number}","notifications_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/labels{/name}","releases_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/releases{/id}","deployments_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/deployments","created_at":"2017-11-09T14:48:49Z","updated_at":"2018-03-28T11:16:58Z","pushed_at":"2018-04-25T10:27:30Z","git_url":"git://github.com/Kentico/cloud-articles-examples.git","ssh_url":"git@github.com:Kentico/cloud-articles-examples.git","clone_url":"https://github.com/Kentico/cloud-articles-examples.git","svn_url":"https://github.com/Kentico/cloud-articles-examples","homepage":null,"size":1260,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Kentico:master","ref":"master","sha":"baa2fbb335b9d73578d71dec97d366e0cb884f5d","user":{"login":"Kentico","id":8819690,"avatar_url":"https://avatars0.githubusercontent.com/u/8819690?v=4","gravatar_id":"","url":"https://api.github.com/users/Kentico","html_url":"https://github.com/Kentico","followers_url":"https://api.github.com/users/Kentico/followers","following_url":"https://api.github.com/users/Kentico/following{/other_user}","gists_url":"https://api.github.com/users/Kentico/gists{/gist_id}","starred_url":"https://api.github.com/users/Kentico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kentico/subscriptions","organizations_url":"https://api.github.com/users/Kentico/orgs","repos_url":"https://api.github.com/users/Kentico/repos","events_url":"https://api.github.com/users/Kentico/events{/privacy}","received_events_url":"https://api.github.com/users/Kentico/received_events","type":"Organization","site_admin":false},"repo":{"id":110127725,"name":"cloud-articles-examples","full_name":"Kentico/cloud-articles-examples","owner":{"login":"Kentico","id":8819690,"avatar_url":"https://avatars0.githubusercontent.com/u/8819690?v=4","gravatar_id":"","url":"https://api.github.com/users/Kentico","html_url":"https://github.com/Kentico","followers_url":"https://api.github.com/users/Kentico/followers","following_url":"https://api.github.com/users/Kentico/following{/other_user}","gists_url":"https://api.github.com/users/Kentico/gists{/gist_id}","starred_url":"https://api.github.com/users/Kentico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kentico/subscriptions","organizations_url":"https://api.github.com/users/Kentico/orgs","repos_url":"https://api.github.com/users/Kentico/repos","events_url":"https://api.github.com/users/Kentico/events{/privacy}","received_events_url":"https://api.github.com/users/Kentico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kentico/cloud-articles-examples","description":"A common repository for code examples used in articles, blog posts, forums, etc.","fork":false,"url":"https://api.github.com/repos/Kentico/cloud-articles-examples","forks_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/forks","keys_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/teams","hooks_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/hooks","issue_events_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/events{/number}","events_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/events","assignees_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/assignees{/user}","branches_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/branches{/branch}","tags_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/tags","blobs_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/statuses/{sha}","languages_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/languages","stargazers_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/stargazers","contributors_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/contributors","subscribers_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/subscribers","subscription_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/subscription","commits_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/contents/{+path}","compare_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/merges","archive_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/downloads","issues_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues{/number}","pulls_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls{/number}","milestones_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/milestones{/number}","notifications_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/labels{/name}","releases_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/releases{/id}","deployments_url":"https://api.github.com/repos/Kentico/cloud-articles-examples/deployments","created_at":"2017-11-09T14:48:49Z","updated_at":"2018-03-28T11:16:58Z","pushed_at":"2018-04-25T10:27:30Z","git_url":"git://github.com/Kentico/cloud-articles-examples.git","ssh_url":"git@github.com:Kentico/cloud-articles-examples.git","clone_url":"https://github.com/Kentico/cloud-articles-examples.git","svn_url":"https://github.com/Kentico/cloud-articles-examples","homepage":null,"size":1260,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2"},"html":{"href":"https://github.com/Kentico/cloud-articles-examples/pull/2"},"issue":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/2"},"comments":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Kentico/cloud-articles-examples/statuses/1b8ba03ea0969cd532b371de18ca8ecd95e9ce9b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"JanLenoch"}}