{"action":"closed","number":231,"pull_request":{"url":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/231","id":157949354,"html_url":"https://github.com/patternfly/patternfly-ng/pull/231","diff_url":"https://github.com/patternfly/patternfly-ng/pull/231.diff","patch_url":"https://github.com/patternfly/patternfly-ng/pull/231.patch","issue_url":"https://api.github.com/repos/patternfly/patternfly-ng/issues/231","number":231,"state":"closed","locked":false,"title":"feat(notifications): add observable for watching notifications array","user":{"login":"seanforyou23","id":5942899,"avatar_url":"https://avatars0.githubusercontent.com/u/5942899?v=4","gravatar_id":"","url":"https://api.github.com/users/seanforyou23","html_url":"https://github.com/seanforyou23","followers_url":"https://api.github.com/users/seanforyou23/followers","following_url":"https://api.github.com/users/seanforyou23/following{/other_user}","gists_url":"https://api.github.com/users/seanforyou23/gists{/gist_id}","starred_url":"https://api.github.com/users/seanforyou23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanforyou23/subscriptions","organizations_url":"https://api.github.com/users/seanforyou23/orgs","repos_url":"https://api.github.com/users/seanforyou23/repos","events_url":"https://api.github.com/users/seanforyou23/events{/privacy}","received_events_url":"https://api.github.com/users/seanforyou23/received_events","type":"User","site_admin":false},"body":"This PR introduces a new property (getNotificationsObserver) to the notification service which wraps the notifications array in an observable. This became necessary when we realized the existing getNotifications() method doesn't work so well while using the OnPush ChangeDetectionStrategy in Angular.\r\n\r\nSolves [[issue-222]](https://github.com/patternfly/patternfly-ng/issues/222)\r\n\r\nOne specific thing I'd like feedback on is how I'm using clearInterval() for the example timer. It works fine in general, but when switching between the tabs quickly you end up building a queue of notifications because the clearInterval doesn't seem to get called if that view is not active. A better approach may be to clearInterval on switching between the tabs, but how to access the timer from within the tabSelected event in notification-service-example.component.ts?\r\n\r\nhttps://rawgit.com/seanforyou23/patternfly-ng/notifications-observable-dist/dist-demo/#/notificationservice\r\n\r\nadd a new getNotificationsObserver property which allows for listening in on notifications activity\r\nupdate stream on add/remove notification from data source\r\nadd a simple wrapper function for updating the stream to enforce DRY\r\nincludes example files for demo app\r\n","created_at":"2017-12-12T21:54:35Z","updated_at":"2017-12-14T21:04:41Z","closed_at":"2017-12-14T21:04:41Z","merged_at":"2017-12-14T21:04:41Z","merge_commit_sha":"5d80f093c360d4420f38895cbc8a1dcc943666ae","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dgutride","id":7306953,"avatar_url":"https://avatars0.githubusercontent.com/u/7306953?v=4","gravatar_id":"","url":"https://api.github.com/users/dgutride","html_url":"https://github.com/dgutride","followers_url":"https://api.github.com/users/dgutride/followers","following_url":"https://api.github.com/users/dgutride/following{/other_user}","gists_url":"https://api.github.com/users/dgutride/gists{/gist_id}","starred_url":"https://api.github.com/users/dgutride/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgutride/subscriptions","organizations_url":"https://api.github.com/users/dgutride/orgs","repos_url":"https://api.github.com/users/dgutride/repos","events_url":"https://api.github.com/users/dgutride/events{/privacy}","received_events_url":"https://api.github.com/users/dgutride/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/231/commits","review_comments_url":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/231/comments","review_comment_url":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/comments{/number}","comments_url":"https://api.github.com/repos/patternfly/patternfly-ng/issues/231/comments","statuses_url":"https://api.github.com/repos/patternfly/patternfly-ng/statuses/2996365acfc61900f1cd31aa5ed87d42635515a1","head":{"label":"seanforyou23:notifications-observable","ref":"notifications-observable","sha":"2996365acfc61900f1cd31aa5ed87d42635515a1","user":{"login":"seanforyou23","id":5942899,"avatar_url":"https://avatars0.githubusercontent.com/u/5942899?v=4","gravatar_id":"","url":"https://api.github.com/users/seanforyou23","html_url":"https://github.com/seanforyou23","followers_url":"https://api.github.com/users/seanforyou23/followers","following_url":"https://api.github.com/users/seanforyou23/following{/other_user}","gists_url":"https://api.github.com/users/seanforyou23/gists{/gist_id}","starred_url":"https://api.github.com/users/seanforyou23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanforyou23/subscriptions","organizations_url":"https://api.github.com/users/seanforyou23/orgs","repos_url":"https://api.github.com/users/seanforyou23/repos","events_url":"https://api.github.com/users/seanforyou23/events{/privacy}","received_events_url":"https://api.github.com/users/seanforyou23/received_events","type":"User","site_admin":false},"repo":{"id":108033229,"name":"patternfly-ng","full_name":"seanforyou23/patternfly-ng","owner":{"login":"seanforyou23","id":5942899,"avatar_url":"https://avatars0.githubusercontent.com/u/5942899?v=4","gravatar_id":"","url":"https://api.github.com/users/seanforyou23","html_url":"https://github.com/seanforyou23","followers_url":"https://api.github.com/users/seanforyou23/followers","following_url":"https://api.github.com/users/seanforyou23/following{/other_user}","gists_url":"https://api.github.com/users/seanforyou23/gists{/gist_id}","starred_url":"https://api.github.com/users/seanforyou23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanforyou23/subscriptions","organizations_url":"https://api.github.com/users/seanforyou23/orgs","repos_url":"https://api.github.com/users/seanforyou23/repos","events_url":"https://api.github.com/users/seanforyou23/events{/privacy}","received_events_url":"https://api.github.com/users/seanforyou23/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seanforyou23/patternfly-ng","description":"PatternFly for Angular 2+","fork":true,"url":"https://api.github.com/repos/seanforyou23/patternfly-ng","forks_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/forks","keys_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/teams","hooks_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/hooks","issue_events_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/issues/events{/number}","events_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/events","assignees_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/assignees{/user}","branches_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/branches{/branch}","tags_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/tags","blobs_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/languages","stargazers_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/stargazers","contributors_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/contributors","subscribers_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/subscribers","subscription_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/subscription","commits_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/contents/{+path}","compare_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/merges","archive_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/downloads","issues_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/issues{/number}","pulls_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/labels{/name}","releases_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/releases{/id}","deployments_url":"https://api.github.com/repos/seanforyou23/patternfly-ng/deployments","created_at":"2017-10-23T20:04:13Z","updated_at":"2017-10-23T20:04:15Z","pushed_at":"2017-12-13T16:52:46Z","git_url":"git://github.com/seanforyou23/patternfly-ng.git","ssh_url":"git@github.com:seanforyou23/patternfly-ng.git","clone_url":"https://github.com/seanforyou23/patternfly-ng.git","svn_url":"https://github.com/seanforyou23/patternfly-ng","homepage":"https://rawgit.com/patternfly/patternfly-ng/master-dist/dist-demo/#/","size":24326,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"patternfly:master","ref":"master","sha":"d90f31b0f8b6ec97a542e91a657a92886865c52a","user":{"login":"patternfly","id":6391110,"avatar_url":"https://avatars3.githubusercontent.com/u/6391110?v=4","gravatar_id":"","url":"https://api.github.com/users/patternfly","html_url":"https://github.com/patternfly","followers_url":"https://api.github.com/users/patternfly/followers","following_url":"https://api.github.com/users/patternfly/following{/other_user}","gists_url":"https://api.github.com/users/patternfly/gists{/gist_id}","starred_url":"https://api.github.com/users/patternfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patternfly/subscriptions","organizations_url":"https://api.github.com/users/patternfly/orgs","repos_url":"https://api.github.com/users/patternfly/repos","events_url":"https://api.github.com/users/patternfly/events{/privacy}","received_events_url":"https://api.github.com/users/patternfly/received_events","type":"Organization","site_admin":false},"repo":{"id":84369917,"name":"patternfly-ng","full_name":"patternfly/patternfly-ng","owner":{"login":"patternfly","id":6391110,"avatar_url":"https://avatars3.githubusercontent.com/u/6391110?v=4","gravatar_id":"","url":"https://api.github.com/users/patternfly","html_url":"https://github.com/patternfly","followers_url":"https://api.github.com/users/patternfly/followers","following_url":"https://api.github.com/users/patternfly/following{/other_user}","gists_url":"https://api.github.com/users/patternfly/gists{/gist_id}","starred_url":"https://api.github.com/users/patternfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patternfly/subscriptions","organizations_url":"https://api.github.com/users/patternfly/orgs","repos_url":"https://api.github.com/users/patternfly/repos","events_url":"https://api.github.com/users/patternfly/events{/privacy}","received_events_url":"https://api.github.com/users/patternfly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/patternfly/patternfly-ng","description":"PatternFly for Angular 4 and 5","fork":false,"url":"https://api.github.com/repos/patternfly/patternfly-ng","forks_url":"https://api.github.com/repos/patternfly/patternfly-ng/forks","keys_url":"https://api.github.com/repos/patternfly/patternfly-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patternfly/patternfly-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patternfly/patternfly-ng/teams","hooks_url":"https://api.github.com/repos/patternfly/patternfly-ng/hooks","issue_events_url":"https://api.github.com/repos/patternfly/patternfly-ng/issues/events{/number}","events_url":"https://api.github.com/repos/patternfly/patternfly-ng/events","assignees_url":"https://api.github.com/repos/patternfly/patternfly-ng/assignees{/user}","branches_url":"https://api.github.com/repos/patternfly/patternfly-ng/branches{/branch}","tags_url":"https://api.github.com/repos/patternfly/patternfly-ng/tags","blobs_url":"https://api.github.com/repos/patternfly/patternfly-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patternfly/patternfly-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patternfly/patternfly-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/patternfly/patternfly-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patternfly/patternfly-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/patternfly/patternfly-ng/languages","stargazers_url":"https://api.github.com/repos/patternfly/patternfly-ng/stargazers","contributors_url":"https://api.github.com/repos/patternfly/patternfly-ng/contributors","subscribers_url":"https://api.github.com/repos/patternfly/patternfly-ng/subscribers","subscription_url":"https://api.github.com/repos/patternfly/patternfly-ng/subscription","commits_url":"https://api.github.com/repos/patternfly/patternfly-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/patternfly/patternfly-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/patternfly/patternfly-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/patternfly/patternfly-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/patternfly/patternfly-ng/contents/{+path}","compare_url":"https://api.github.com/repos/patternfly/patternfly-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patternfly/patternfly-ng/merges","archive_url":"https://api.github.com/repos/patternfly/patternfly-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patternfly/patternfly-ng/downloads","issues_url":"https://api.github.com/repos/patternfly/patternfly-ng/issues{/number}","pulls_url":"https://api.github.com/repos/patternfly/patternfly-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/patternfly/patternfly-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/patternfly/patternfly-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patternfly/patternfly-ng/labels{/name}","releases_url":"https://api.github.com/repos/patternfly/patternfly-ng/releases{/id}","deployments_url":"https://api.github.com/repos/patternfly/patternfly-ng/deployments","created_at":"2017-03-08T21:55:44Z","updated_at":"2017-12-13T21:45:08Z","pushed_at":"2017-12-14T21:04:41Z","git_url":"git://github.com/patternfly/patternfly-ng.git","ssh_url":"git@github.com:patternfly/patternfly-ng.git","clone_url":"https://github.com/patternfly/patternfly-ng.git","svn_url":"https://github.com/patternfly/patternfly-ng","homepage":"https://rawgit.com/patternfly/patternfly-ng/master-dist/dist-demo/#/","size":38713,"stargazers_count":27,"watchers_count":27,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":24,"open_issues":33,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/231"},"html":{"href":"https://github.com/patternfly/patternfly-ng/pull/231"},"issue":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/issues/231"},"comments":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/issues/231/comments"},"review_comments":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/231/comments"},"review_comment":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/pulls/231/commits"},"statuses":{"href":"https://api.github.com/repos/patternfly/patternfly-ng/statuses/2996365acfc61900f1cd31aa5ed87d42635515a1"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"dlabrecq","id":17481322,"avatar_url":"https://avatars2.githubusercontent.com/u/17481322?v=4","gravatar_id":"","url":"https://api.github.com/users/dlabrecq","html_url":"https://github.com/dlabrecq","followers_url":"https://api.github.com/users/dlabrecq/followers","following_url":"https://api.github.com/users/dlabrecq/following{/other_user}","gists_url":"https://api.github.com/users/dlabrecq/gists{/gist_id}","starred_url":"https://api.github.com/users/dlabrecq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlabrecq/subscriptions","organizations_url":"https://api.github.com/users/dlabrecq/orgs","repos_url":"https://api.github.com/users/dlabrecq/repos","events_url":"https://api.github.com/users/dlabrecq/events{/privacy}","received_events_url":"https://api.github.com/users/dlabrecq/received_events","type":"User","site_admin":false},"comments":0,"review_comments":1,"maintainer_can_modify":false,"commits":2,"additions":216,"deletions":63,"changed_files":10}}
{"actor":{"display_login":"dlabrecq"}}