{"action":"closed","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1148","labels_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1148/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1148/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1148/events","html_url":"https://github.com/ReactiveX/RxJS/issues/1148","id":125511218,"number":1148,"title":"Why doesn't a hot observable stay hot?","user":{"login":"jhoguet","id":1234146,"avatar_url":"https://avatars.githubusercontent.com/u/1234146?v=3","gravatar_id":"","url":"https://api.github.com/users/jhoguet","html_url":"https://github.com/jhoguet","followers_url":"https://api.github.com/users/jhoguet/followers","following_url":"https://api.github.com/users/jhoguet/following{/other_user}","gists_url":"https://api.github.com/users/jhoguet/gists{/gist_id}","starred_url":"https://api.github.com/users/jhoguet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhoguet/subscriptions","organizations_url":"https://api.github.com/users/jhoguet/orgs","repos_url":"https://api.github.com/users/jhoguet/repos","events_url":"https://api.github.com/users/jhoguet/events{/privacy}","received_events_url":"https://api.github.com/users/jhoguet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-07T23:49:23Z","updated_at":"2016-01-09T00:29:17Z","closed_at":"2016-01-09T00:29:17Z","body":"Why doesn't a hot observable stay hot?\r\n\r\nFor instance...\r\n\r\n```js\r\nconst s = new Rx.Subject();\r\n\r\no = s.map(i => {\r\n  console.log('side effect ' + i)\r\n  return i * 2;\r\n});\r\n\r\no.subscribe(v => console.log(v));\r\no.subscribe(v => console.log(v));\r\n\r\ns.next(2)\r\n```\r\noutputs\r\n>side effect 2\r\n4\r\nside effect 2\r\n4\r\n\r\nBut this is not what I would expect. I can fix this by using `o.share()`\r\n\r\nBut why would I need to do that? Given that the Subject is pushing the same input, I should get the same output to functions like map. Isn't this the whole point of shifting to an RFP approach? From my point of view this only benefits those that are causing side effects in map because otherwise they would never know or care. Given that you have an operator like do we could preserve the current default by making do be the point at which the observable stops sharing.\r\n\r\nI suspect there is either a fundamental RFP reason for this which I have not learned yet, or this is incidental complexity caused by some implementation detail. If it is the latter I would love to find a way to fix that before 5 comes out of beta.\r\n\r\nMoved the question from https://github.com/ReactiveX/RxJS/issues/1121#issuecomment-169568428\r\n\r\n@trxcllnt provided some great feedback that the `.map` is producing a new cold observable [here](https://github.com/ReactiveX/RxJS/issues/1121#issuecomment-169568428) \r\n\r\nThis is not what I would expect. I would not expect two subscribers to get different values from the same `map` of the same `Subject`.  Therefore the computation of the `map` should be memoized / only happen once for all subscribers. \r\n\r\nBecause this isn't true, I need to re-coerce the Observable back to hot everytime I perform an operation on it by calling `share` on it. \r\n\r\nWhile this doesn't seem terrible in one module\r\n\r\n```\r\nconst s = new Rx.Subject();\r\n\r\no = s.map(i => i * 2 }).share();\r\n```\r\n\r\nit starts to smell like a leaking concern when the operations are happening across modules. \r\n```\r\nfunction doubleIt(stream){\r\n    return stream.map(i => i*2);\r\n}\r\n```\r\n\r\nIt adds to the cognitive overhead of using RxJS as I need to track which observables are hot or cold or sacrifice performance by recomputing unnecessarily. \r\n\r\nWhy doesn't a hot observable stay hot?\r\n\r\nPS - I have been watching the hard work you guys are doing and am very thankful!\r\n\r\n"}}