{"action":"opened","issue":{"url":"https://api.github.com/repos/paldepind/flyd/issues/72","labels_url":"https://api.github.com/repos/paldepind/flyd/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/paldepind/flyd/issues/72/comments","events_url":"https://api.github.com/repos/paldepind/flyd/issues/72/events","html_url":"https://github.com/paldepind/flyd/issues/72","id":117300333,"number":72,"title":"Using flyd.on returns undefined instead of a stream","user":{"login":"qur2","id":143227,"avatar_url":"https://avatars.githubusercontent.com/u/143227?v=3","gravatar_id":"","url":"https://api.github.com/users/qur2","html_url":"https://github.com/qur2","followers_url":"https://api.github.com/users/qur2/followers","following_url":"https://api.github.com/users/qur2/following{/other_user}","gists_url":"https://api.github.com/users/qur2/gists{/gist_id}","starred_url":"https://api.github.com/users/qur2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qur2/subscriptions","organizations_url":"https://api.github.com/users/qur2/orgs","repos_url":"https://api.github.com/users/qur2/repos","events_url":"https://api.github.com/users/qur2/events{/privacy}","received_events_url":"https://api.github.com/users/qur2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-17T07:31:07Z","updated_at":"2015-11-17T07:31:07Z","closed_at":null,"body":"I'm using flyd along with React and I'm trying to get rid of one of its warning. Basically, I found out that I may have some kind of race condition and therefore decided to manually clean up all streams when a component unmounts.\r\n\r\nLong story short: `flyd.on()` returns `undefined` instead of a stream that I could then close. Did I miss something or is that a real issue?\r\n\r\n```javascript\r\nvar s1 = f.stream()\r\nvar s2 = f.on(function(x) {console.log(x)}, s1)\r\ns1\r\nstream(undefined)\r\ns2\r\nundefined\r\ns2.end\r\nVM26253:1 Uncaught TypeError: Cannot read property 'end' of undefined(…)\r\n```\r\n\r\nThanks for the library, I've been playing with the RxJS and likes, and this one is much easier to get into!"}}