{"action":"created","comment":{"url":"https://api.github.com/repos/cyclejs/collection/pulls/comments/65489396","id":65489396,"diff_hunk":"@@ -39,48 +39,55 @@ function makeItem (component, sources, props) {\n   return newItem;\n }\n \n-function Collection (component, sources = {}, handlers = {}, items = [], handler$Hash = {}, reducers = xs.create()) {\n-  return {\n-    add (additionalSources = {}) {\n-      const newItem = makeItem(component, {...sources, ...additionalSources});\n-      const handler$ = handlerStreams(component, newItem, handlers);\n-      reducers.imitate(handler$);\n-\n-      return Collection(\n-        component,\n-        sources,\n-        handlers,\n-        [...items, newItem],\n-        {\n-          ...handler$Hash,\n-          [newItem.id]: handler$\n-        },\n-        reducers\n-      );\n+function Collection (component, sources = {}, handlers = {}) {\n+  const reducers = xs.create();\n+  const proxy = {\n+    next(value) {\n+      reducers.shamefullySendNext(value);\n     },\n-\n-    remove (itemForRemoval) {\n-      const id = itemForRemoval && itemForRemoval.id;\n-      id && handler$Hash[id] && handler$Hash[id].shamefullySendComplete();\n-      return Collection(\n-        component,\n-        sources,\n-        handlers,\n-        items.filter(item => item !== itemForRemoval),\n-        {\n-          ...handler$Hash,\n-          [id]: null\n-        },  \n-        reducers\n-      );\n-    },\n-\n-    asArray () {\n-      return items.slice(); // returns a copy of items to avoid mutation\n+    error(err) {\n+      reducers.shamefullySendError(err);\n     },\n+    complete() {\n+      // Maybe autoremove here?\n+    }\n+  }\n \n-    reducers\n-  };\n+  return (function _Collection(items = [], handler$Hash = {}) {","path":"src/collection.js","position":57,"original_position":57,"commit_id":"ede011b2be6382603ba51ee205f520345e171a2a","original_commit_id":"ede011b2be6382603ba51ee205f520345e171a2a","user":{"login":"Widdershin","id":398365,"avatar_url":"https://avatars.githubusercontent.com/u/398365?v=3","gravatar_id":"","url":"https://api.github.com/users/Widdershin","html_url":"https://github.com/Widdershin","followers_url":"https://api.github.com/users/Widdershin/followers","following_url":"https://api.github.com/users/Widdershin/following{/other_user}","gists_url":"https://api.github.com/users/Widdershin/gists{/gist_id}","starred_url":"https://api.github.com/users/Widdershin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Widdershin/subscriptions","organizations_url":"https://api.github.com/users/Widdershin/orgs","repos_url":"https://api.github.com/users/Widdershin/repos","events_url":"https://api.github.com/users/Widdershin/events{/privacy}","received_events_url":"https://api.github.com/users/Widdershin/received_events","type":"User","site_admin":false},"body":"I would suggest just keeping them as args. In fact, if we make a `Collection` function to shroud the interface we can have our args as an object, which means we can use the object spread operator to tidy up `add` and `remove`.","created_at":"2016-06-02T06:23:25Z","updated_at":"2016-06-02T06:23:25Z","html_url":"https://github.com/cyclejs/collection/pull/7#discussion_r65489396","pull_request_url":"https://api.github.com/repos/cyclejs/collection/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/cyclejs/collection/pulls/comments/65489396"},"html":{"href":"https://github.com/cyclejs/collection/pull/7#discussion_r65489396"},"pull_request":{"href":"https://api.github.com/repos/cyclejs/collection/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/cyclejs/collection/pulls/7","id":71843736,"html_url":"https://github.com/cyclejs/collection/pull/7","diff_url":"https://github.com/cyclejs/collection/pull/7.diff","patch_url":"https://github.com/cyclejs/collection/pull/7.patch","issue_url":"https://api.github.com/repos/cyclejs/collection/issues/7","number":7,"state":"open","locked":false,"title":"Explicit proxying","user":{"login":"Hypnosphi","id":6651625,"avatar_url":"https://avatars.githubusercontent.com/u/6651625?v=3","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":"See https://github.com/cyclejs/collection/issues/6","created_at":"2016-05-30T01:17:44Z","updated_at":"2016-06-02T06:23:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33d95d8d12c1cafd5e400a3b2472ac0a59d2fc5f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cyclejs/collection/pulls/7/commits","review_comments_url":"https://api.github.com/repos/cyclejs/collection/pulls/7/comments","review_comment_url":"https://api.github.com/repos/cyclejs/collection/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cyclejs/collection/issues/7/comments","statuses_url":"https://api.github.com/repos/cyclejs/collection/statuses/ede011b2be6382603ba51ee205f520345e171a2a","head":{"label":"Hypnosphi:master","ref":"master","sha":"ede011b2be6382603ba51ee205f520345e171a2a","user":{"login":"Hypnosphi","id":6651625,"avatar_url":"https://avatars.githubusercontent.com/u/6651625?v=3","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},"repo":{"id":59649657,"name":"collection","full_name":"Hypnosphi/collection","owner":{"login":"Hypnosphi","id":6651625,"avatar_url":"https://avatars.githubusercontent.com/u/6651625?v=3","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},"private":false,"html_url":"https://github.com/Hypnosphi/collection","description":"","fork":true,"url":"https://api.github.com/repos/Hypnosphi/collection","forks_url":"https://api.github.com/repos/Hypnosphi/collection/forks","keys_url":"https://api.github.com/repos/Hypnosphi/collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hypnosphi/collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hypnosphi/collection/teams","hooks_url":"https://api.github.com/repos/Hypnosphi/collection/hooks","issue_events_url":"https://api.github.com/repos/Hypnosphi/collection/issues/events{/number}","events_url":"https://api.github.com/repos/Hypnosphi/collection/events","assignees_url":"https://api.github.com/repos/Hypnosphi/collection/assignees{/user}","branches_url":"https://api.github.com/repos/Hypnosphi/collection/branches{/branch}","tags_url":"https://api.github.com/repos/Hypnosphi/collection/tags","blobs_url":"https://api.github.com/repos/Hypnosphi/collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hypnosphi/collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hypnosphi/collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hypnosphi/collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hypnosphi/collection/statuses/{sha}","languages_url":"https://api.github.com/repos/Hypnosphi/collection/languages","stargazers_url":"https://api.github.com/repos/Hypnosphi/collection/stargazers","contributors_url":"https://api.github.com/repos/Hypnosphi/collection/contributors","subscribers_url":"https://api.github.com/repos/Hypnosphi/collection/subscribers","subscription_url":"https://api.github.com/repos/Hypnosphi/collection/subscription","commits_url":"https://api.github.com/repos/Hypnosphi/collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hypnosphi/collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hypnosphi/collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hypnosphi/collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hypnosphi/collection/contents/{+path}","compare_url":"https://api.github.com/repos/Hypnosphi/collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hypnosphi/collection/merges","archive_url":"https://api.github.com/repos/Hypnosphi/collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hypnosphi/collection/downloads","issues_url":"https://api.github.com/repos/Hypnosphi/collection/issues{/number}","pulls_url":"https://api.github.com/repos/Hypnosphi/collection/pulls{/number}","milestones_url":"https://api.github.com/repos/Hypnosphi/collection/milestones{/number}","notifications_url":"https://api.github.com/repos/Hypnosphi/collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hypnosphi/collection/labels{/name}","releases_url":"https://api.github.com/repos/Hypnosphi/collection/releases{/id}","deployments_url":"https://api.github.com/repos/Hypnosphi/collection/deployments","created_at":"2016-05-25T09:24:22Z","updated_at":"2016-05-29T21:04:45Z","pushed_at":"2016-05-30T01:25:20Z","git_url":"git://github.com/Hypnosphi/collection.git","ssh_url":"git@github.com:Hypnosphi/collection.git","clone_url":"https://github.com/Hypnosphi/collection.git","svn_url":"https://github.com/Hypnosphi/collection","homepage":null,"size":47,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"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":"cyclejs:master","ref":"master","sha":"ec022713ccb0a1af6d610fe7cd12de2959574b9d","user":{"login":"cyclejs","id":12686838,"avatar_url":"https://avatars.githubusercontent.com/u/12686838?v=3","gravatar_id":"","url":"https://api.github.com/users/cyclejs","html_url":"https://github.com/cyclejs","followers_url":"https://api.github.com/users/cyclejs/followers","following_url":"https://api.github.com/users/cyclejs/following{/other_user}","gists_url":"https://api.github.com/users/cyclejs/gists{/gist_id}","starred_url":"https://api.github.com/users/cyclejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyclejs/subscriptions","organizations_url":"https://api.github.com/users/cyclejs/orgs","repos_url":"https://api.github.com/users/cyclejs/repos","events_url":"https://api.github.com/users/cyclejs/events{/privacy}","received_events_url":"https://api.github.com/users/cyclejs/received_events","type":"Organization","site_admin":false},"repo":{"id":59455622,"name":"collection","full_name":"cyclejs/collection","owner":{"login":"cyclejs","id":12686838,"avatar_url":"https://avatars.githubusercontent.com/u/12686838?v=3","gravatar_id":"","url":"https://api.github.com/users/cyclejs","html_url":"https://github.com/cyclejs","followers_url":"https://api.github.com/users/cyclejs/followers","following_url":"https://api.github.com/users/cyclejs/following{/other_user}","gists_url":"https://api.github.com/users/cyclejs/gists{/gist_id}","starred_url":"https://api.github.com/users/cyclejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyclejs/subscriptions","organizations_url":"https://api.github.com/users/cyclejs/orgs","repos_url":"https://api.github.com/users/cyclejs/repos","events_url":"https://api.github.com/users/cyclejs/events{/privacy}","received_events_url":"https://api.github.com/users/cyclejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cyclejs/collection","description":"","fork":false,"url":"https://api.github.com/repos/cyclejs/collection","forks_url":"https://api.github.com/repos/cyclejs/collection/forks","keys_url":"https://api.github.com/repos/cyclejs/collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyclejs/collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyclejs/collection/teams","hooks_url":"https://api.github.com/repos/cyclejs/collection/hooks","issue_events_url":"https://api.github.com/repos/cyclejs/collection/issues/events{/number}","events_url":"https://api.github.com/repos/cyclejs/collection/events","assignees_url":"https://api.github.com/repos/cyclejs/collection/assignees{/user}","branches_url":"https://api.github.com/repos/cyclejs/collection/branches{/branch}","tags_url":"https://api.github.com/repos/cyclejs/collection/tags","blobs_url":"https://api.github.com/repos/cyclejs/collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyclejs/collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyclejs/collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyclejs/collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyclejs/collection/statuses/{sha}","languages_url":"https://api.github.com/repos/cyclejs/collection/languages","stargazers_url":"https://api.github.com/repos/cyclejs/collection/stargazers","contributors_url":"https://api.github.com/repos/cyclejs/collection/contributors","subscribers_url":"https://api.github.com/repos/cyclejs/collection/subscribers","subscription_url":"https://api.github.com/repos/cyclejs/collection/subscription","commits_url":"https://api.github.com/repos/cyclejs/collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyclejs/collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyclejs/collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyclejs/collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyclejs/collection/contents/{+path}","compare_url":"https://api.github.com/repos/cyclejs/collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyclejs/collection/merges","archive_url":"https://api.github.com/repos/cyclejs/collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyclejs/collection/downloads","issues_url":"https://api.github.com/repos/cyclejs/collection/issues{/number}","pulls_url":"https://api.github.com/repos/cyclejs/collection/pulls{/number}","milestones_url":"https://api.github.com/repos/cyclejs/collection/milestones{/number}","notifications_url":"https://api.github.com/repos/cyclejs/collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyclejs/collection/labels{/name}","releases_url":"https://api.github.com/repos/cyclejs/collection/releases{/id}","deployments_url":"https://api.github.com/repos/cyclejs/collection/deployments","created_at":"2016-05-23T05:54:55Z","updated_at":"2016-06-02T00:48:10Z","pushed_at":"2016-05-30T01:17:44Z","git_url":"git://github.com/cyclejs/collection.git","ssh_url":"git@github.com:cyclejs/collection.git","clone_url":"https://github.com/cyclejs/collection.git","svn_url":"https://github.com/cyclejs/collection","homepage":null,"size":42,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cyclejs/collection/pulls/7"},"html":{"href":"https://github.com/cyclejs/collection/pull/7"},"issue":{"href":"https://api.github.com/repos/cyclejs/collection/issues/7"},"comments":{"href":"https://api.github.com/repos/cyclejs/collection/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/cyclejs/collection/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/cyclejs/collection/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cyclejs/collection/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/cyclejs/collection/statuses/ede011b2be6382603ba51ee205f520345e171a2a"}}}}
{"actor":{"display_login":"Widdershin"}}