{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments/53221459","id":53221459,"diff_hunk":"@@ -626,7 +626,34 @@ class SignalSpec: QuickSpec {\n \t\t\t\texpect(values) == [ \"a\", \"cc\", \"d\" ]\n \t\t\t}\n \t\t}\n+\t\t\n+\t\tdescribe(\"uniqueValues\", {\n+\t\t\tit(\"should skip values that have been already seen\"){\n+\t\t\t\tlet (baseSignal, observer) = Signal<String, NoError>.pipe()\n+\t\t\t\tlet signal = baseSignal.uniqueValues()\n+\t\t\t\t\n+\t\t\t\tvar values: [String] = []\n+\t\t\t\tsignal.observeNext { values.append($0) }\n+\t\t\t\t\n+\t\t\t\texpect(values) == []\n \n+\t\t\t\tobserver.sendNext(\"a\")\n+\t\t\t\texpect(values) == [ \"a\" ]\n+\t\t\t\t\n+\t\t\t\tobserver.sendNext(\"b\")\n+\t\t\t\texpect(values) == [ \"a\", \"b\" ]\n+\t\t\t\t\n+\t\t\t\tobserver.sendNext(\"a\")\n+\t\t\t\texpect(values) == [ \"a\", \"b\" ]\n+\t\t\t\t\n+\t\t\t\tobserver.sendNext(\"b\")\n+\t\t\t\texpect(values) == [ \"a\", \"b\" ]\n+\t\t\t\t\n+\t\t\t\tobserver.sendNext(\"c\")\n+\t\t\t\texpect(values) == [ \"a\", \"b\", \"c\"]\n+\t\t\t}","path":"ReactiveCocoaTests/Swift/SignalSpec.swift","position":29,"original_position":29,"commit_id":"143d52bbaa44f921dc9741568c9c2f3509820e5f","original_commit_id":"143d52bbaa44f921dc9741568c9c2f3509820e5f","user":{"login":"NachoSoto","id":685609,"avatar_url":"https://avatars.githubusercontent.com/u/685609?v=3","gravatar_id":"","url":"https://api.github.com/users/NachoSoto","html_url":"https://github.com/NachoSoto","followers_url":"https://api.github.com/users/NachoSoto/followers","following_url":"https://api.github.com/users/NachoSoto/following{/other_user}","gists_url":"https://api.github.com/users/NachoSoto/gists{/gist_id}","starred_url":"https://api.github.com/users/NachoSoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NachoSoto/subscriptions","organizations_url":"https://api.github.com/users/NachoSoto/orgs","repos_url":"https://api.github.com/users/NachoSoto/repos","events_url":"https://api.github.com/users/NachoSoto/events{/privacy}","received_events_url":"https://api.github.com/users/NachoSoto/received_events","type":"User","site_admin":false},"body":"Maybe to be safe, can you call `observer.sendCompleted()` and verify that `values` has not changed?","created_at":"2016-02-17T19:55:40Z","updated_at":"2016-02-17T19:55:40Z","html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2715#discussion_r53221459","pull_request_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715","_links":{"self":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments/53221459"},"html":{"href":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2715#discussion_r53221459"},"pull_request":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715","id":58572246,"html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2715","diff_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2715.diff","patch_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2715.patch","issue_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2715","number":2715,"state":"open","locked":false,"title":"Add `.uniqueValues` to SignalProducer","user":{"login":"nixterrimus","id":18454,"avatar_url":"https://avatars.githubusercontent.com/u/18454?v=3","gravatar_id":"","url":"https://api.github.com/users/nixterrimus","html_url":"https://github.com/nixterrimus","followers_url":"https://api.github.com/users/nixterrimus/followers","following_url":"https://api.github.com/users/nixterrimus/following{/other_user}","gists_url":"https://api.github.com/users/nixterrimus/gists{/gist_id}","starred_url":"https://api.github.com/users/nixterrimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nixterrimus/subscriptions","organizations_url":"https://api.github.com/users/nixterrimus/orgs","repos_url":"https://api.github.com/users/nixterrimus/repos","events_url":"https://api.github.com/users/nixterrimus/events{/privacy}","received_events_url":"https://api.github.com/users/nixterrimus/received_events","type":"User","site_admin":false},"body":"Adds a `uniqueValues` function to SignalProducer so that only values that are unique across the entire stream will be sent.\r\n\r\n## Rationale\r\n\r\nA common operation that I've needed for a recent project is to take only the unique values that come out of a SignalProducer.  In this project I have a data source which returns snapshots are regular intervals, however what I want is only the items that have never been seen before.  I've needed this in several places and so I've generalized it into a pull request.\r\n\r\n## Quick Demo\r\n\r\n![quickdemo](https://cloud.githubusercontent.com/assets/18454/12878974/91d9b9a8-cde1-11e5-9765-cf9f6dd7ee38.png)\r\n\r\n## Work Done\r\n\r\n- [x] Code for `uniqueValues`\r\n- [x] Inline documentation\r\n- [x] Tests for `uniqueValues`\r\n\r\n## Todo\r\n\r\n- [x] Note that this causes values to be retained\r\n- [x] Make accessing and mutating set thread safe\r\n- [x] Fix so that each call to `start` gets its own Set\r\n- [x] Add lifted Signal version\r\n\r\n## Feedback\r\n\r\n- Is this something that makes sense in the ReactiveCocoa proper?\r\n- Is `uniqueValues` a good name for the operation?\r\n- Is there anything else I can do to make this code feel at home in RAC?\r\n\r\n## Thanks\r\n\r\nI've been using ReactiveCocoa for the last 6 months and it's changed the way I write applications.  This is my first contribution and I want to say thanks for maintaining a project which has been very useful to me.  🎉","created_at":"2016-02-08T05:29:10Z","updated_at":"2016-02-17T19:55:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38cee107d5481489af1942f37bb97ec17ec9d48c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715/commits","review_comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715/comments","review_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2715/comments","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/statuses/143d52bbaa44f921dc9741568c9c2f3509820e5f","head":{"label":"nixterrimus:skip_unique_values","ref":"skip_unique_values","sha":"143d52bbaa44f921dc9741568c9c2f3509820e5f","user":{"login":"nixterrimus","id":18454,"avatar_url":"https://avatars.githubusercontent.com/u/18454?v=3","gravatar_id":"","url":"https://api.github.com/users/nixterrimus","html_url":"https://github.com/nixterrimus","followers_url":"https://api.github.com/users/nixterrimus/followers","following_url":"https://api.github.com/users/nixterrimus/following{/other_user}","gists_url":"https://api.github.com/users/nixterrimus/gists{/gist_id}","starred_url":"https://api.github.com/users/nixterrimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nixterrimus/subscriptions","organizations_url":"https://api.github.com/users/nixterrimus/orgs","repos_url":"https://api.github.com/users/nixterrimus/repos","events_url":"https://api.github.com/users/nixterrimus/events{/privacy}","received_events_url":"https://api.github.com/users/nixterrimus/received_events","type":"User","site_admin":false},"repo":{"id":51280669,"name":"ReactiveCocoa","full_name":"nixterrimus/ReactiveCocoa","owner":{"login":"nixterrimus","id":18454,"avatar_url":"https://avatars.githubusercontent.com/u/18454?v=3","gravatar_id":"","url":"https://api.github.com/users/nixterrimus","html_url":"https://github.com/nixterrimus","followers_url":"https://api.github.com/users/nixterrimus/followers","following_url":"https://api.github.com/users/nixterrimus/following{/other_user}","gists_url":"https://api.github.com/users/nixterrimus/gists{/gist_id}","starred_url":"https://api.github.com/users/nixterrimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nixterrimus/subscriptions","organizations_url":"https://api.github.com/users/nixterrimus/orgs","repos_url":"https://api.github.com/users/nixterrimus/repos","events_url":"https://api.github.com/users/nixterrimus/events{/privacy}","received_events_url":"https://api.github.com/users/nixterrimus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nixterrimus/ReactiveCocoa","description":"Streams of values over time","fork":true,"url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa","forks_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/forks","keys_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/teams","hooks_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/hooks","issue_events_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/issues/events{/number}","events_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/events","assignees_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/assignees{/user}","branches_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/branches{/branch}","tags_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/tags","blobs_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/languages","stargazers_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/stargazers","contributors_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/contributors","subscribers_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/subscribers","subscription_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/subscription","commits_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/contents/{+path}","compare_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/merges","archive_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/downloads","issues_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/issues{/number}","pulls_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/labels{/name}","releases_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/releases{/id}","deployments_url":"https://api.github.com/repos/nixterrimus/ReactiveCocoa/deployments","created_at":"2016-02-08T05:21:01Z","updated_at":"2016-02-08T05:21:05Z","pushed_at":"2016-02-09T05:32:45Z","git_url":"git://github.com/nixterrimus/ReactiveCocoa.git","ssh_url":"git@github.com:nixterrimus/ReactiveCocoa.git","clone_url":"https://github.com/nixterrimus/ReactiveCocoa.git","svn_url":"https://github.com/nixterrimus/ReactiveCocoa","homepage":"","size":15431,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ReactiveCocoa:master","ref":"master","sha":"94efab0f505eadce512b3ff0ebb923d9ae3bf7e5","user":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"repo":{"id":3606624,"name":"ReactiveCocoa","full_name":"ReactiveCocoa/ReactiveCocoa","owner":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa","description":"Streams of values over time","fork":false,"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa","forks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/forks","keys_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/teams","hooks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/hooks","issue_events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/events","assignees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/tags","blobs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/languages","stargazers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/stargazers","contributors_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/contributors","subscribers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/subscribers","subscription_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/subscription","commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/merges","archive_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/downloads","issues_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/releases{/id}","deployments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/deployments","created_at":"2012-03-02T22:11:24Z","updated_at":"2016-02-17T15:49:50Z","pushed_at":"2016-02-17T13:04:28Z","git_url":"git://github.com/ReactiveCocoa/ReactiveCocoa.git","ssh_url":"git@github.com:ReactiveCocoa/ReactiveCocoa.git","clone_url":"https://github.com/ReactiveCocoa/ReactiveCocoa.git","svn_url":"https://github.com/ReactiveCocoa/ReactiveCocoa","homepage":"","size":23709,"stargazers_count":12612,"watchers_count":12612,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2255,"mirror_url":null,"open_issues_count":253,"forks":2255,"open_issues":253,"watchers":12612,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715"},"html":{"href":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2715"},"issue":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2715"},"comments":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2715/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2715/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/statuses/143d52bbaa44f921dc9741568c9c2f3509820e5f"}}}}