{"action":"closed","issue":{"url":"https://api.github.com/repos/acdlite/recompose/issues/176","repository_url":"https://api.github.com/repos/acdlite/recompose","labels_url":"https://api.github.com/repos/acdlite/recompose/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/acdlite/recompose/issues/176/comments","events_url":"https://api.github.com/repos/acdlite/recompose/issues/176/events","html_url":"https://github.com/acdlite/recompose/issues/176","id":155783228,"number":176,"title":"(rx-recompose) createEventHandler.js","user":{"login":"b2whats","id":6803842,"avatar_url":"https://avatars.githubusercontent.com/u/6803842?v=3","gravatar_id":"","url":"https://api.github.com/users/b2whats","html_url":"https://github.com/b2whats","followers_url":"https://api.github.com/users/b2whats/followers","following_url":"https://api.github.com/users/b2whats/following{/other_user}","gists_url":"https://api.github.com/users/b2whats/gists{/gist_id}","starred_url":"https://api.github.com/users/b2whats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b2whats/subscriptions","organizations_url":"https://api.github.com/users/b2whats/orgs","repos_url":"https://api.github.com/users/b2whats/repos","events_url":"https://api.github.com/users/b2whats/events{/privacy}","received_events_url":"https://api.github.com/users/b2whats/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-19T16:44:42Z","updated_at":"2016-05-19T19:25:21Z","closed_at":"2016-05-19T19:25:21Z","body":"why in your implementation you are using Observable.create, not Subject\r\n\r\noriginal\r\n```js\r\nimport { Observable } from 'rx'\r\nimport { createChangeEmitter } from 'change-emitter'\r\n\r\nconst createEventHandler = () => {\r\n  const emitter = createChangeEmitter()\r\n  const stream = Observable.create(observer =>\r\n    emitter.listen(value => observer.onNext(value))\r\n  )\r\n  return {\r\n    handler: emitter.emit,\r\n    stream\r\n  }\r\n}\r\n\r\nexport default createEventHandler\r\n```\r\nsubject\r\n```js\r\nimport Rx from 'rx'\r\n\r\nconst createEventHandler = () => {\r\n  const stream = new Rx.Subject()\r\n\r\n  return {\r\n    handler: (value) =>  stream.next(value),\r\n    stream\r\n  }\r\n}\r\n\r\nexport default createEventHandler\r\n```\r\n\r\n"}}