{"action":"created","issue":{"url":"https://api.github.com/repos/Reactive-Extensions/RxJS/issues/175","repository_url":"https://api.github.com/repos/Reactive-Extensions/RxJS","labels_url":"https://api.github.com/repos/Reactive-Extensions/RxJS/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/Reactive-Extensions/RxJS/issues/175/comments","events_url":"https://api.github.com/repos/Reactive-Extensions/RxJS/issues/175/events","html_url":"https://github.com/Reactive-Extensions/RxJS/issues/175","id":35105967,"number":175,"title":"Subject with bufferWithTime keeps firing","user":{"login":"lmeyerov","id":4249447,"avatar_url":"https://avatars.githubusercontent.com/u/4249447?v=3","gravatar_id":"","url":"https://api.github.com/users/lmeyerov","html_url":"https://github.com/lmeyerov","followers_url":"https://api.github.com/users/lmeyerov/followers","following_url":"https://api.github.com/users/lmeyerov/following{/other_user}","gists_url":"https://api.github.com/users/lmeyerov/gists{/gist_id}","starred_url":"https://api.github.com/users/lmeyerov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmeyerov/subscriptions","organizations_url":"https://api.github.com/users/lmeyerov/orgs","repos_url":"https://api.github.com/users/lmeyerov/repos","events_url":"https://api.github.com/users/lmeyerov/events{/privacy}","received_events_url":"https://api.github.com/users/lmeyerov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2014-06-05T23:01:25Z","updated_at":"2016-09-07T01:24:57Z","closed_at":"2014-09-26T00:47:03Z","body":"To reproduce, in JS console:\r\n\r\n(new Rx.Subject()).bufferWithTime(100).subscribe(function (v) { console.log('hit', v); })\r\n\r\nExpected result: No output.\r\n\r\nResult: infinite stream of hit [], hit [], hit [], ...\r\n\r\nThis may be related to another bug where .sample() keeps running in the background even when it should be inactive. (In that case, subscribe won't be called, but CPU cycles will still activate, which prevents putting the app to sleep.)"},"comment":{"url":"https://api.github.com/repos/Reactive-Extensions/RxJS/issues/comments/245147503","html_url":"https://github.com/Reactive-Extensions/RxJS/issues/175#issuecomment-245147503","issue_url":"https://api.github.com/repos/Reactive-Extensions/RxJS/issues/175","id":245147503,"user":{"login":"alobakov","id":13771032,"avatar_url":"https://avatars.githubusercontent.com/u/13771032?v=3","gravatar_id":"","url":"https://api.github.com/users/alobakov","html_url":"https://github.com/alobakov","followers_url":"https://api.github.com/users/alobakov/followers","following_url":"https://api.github.com/users/alobakov/following{/other_user}","gists_url":"https://api.github.com/users/alobakov/gists{/gist_id}","starred_url":"https://api.github.com/users/alobakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alobakov/subscriptions","organizations_url":"https://api.github.com/users/alobakov/orgs","repos_url":"https://api.github.com/users/alobakov/repos","events_url":"https://api.github.com/users/alobakov/events{/privacy}","received_events_url":"https://api.github.com/users/alobakov/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T01:24:57Z","updated_at":"2016-09-07T01:24:57Z","body":"I know this topic is old, but please add my vote for including this very useful operator into the framework. Just like the OP and the other folks, I was intuitively expecting with good certainty that the buffer would wait until there were values available, instead of producing an empty result every N milliseconds. Naturally, when we're thinking within the \"Observable\" (or reactive in general) realm, the typical expectation is that a subscriber will only be called once a value(s) becomes available on the observable, but not sooner. That is a **_reaction_**. \r\nThe timeout parameter on the operator then looks like it merely defines a **_grouping timeframe_** within which **_any_** incoming values (if available) would be combined into one collection before calling subscribers, provided there's something to produce.\r\nReason for this thinking being : if not for this expectation, then why bother using an observable at all for this case? One could easily accomplish the same buffering behavior with a simple timer and a plain buffer array, which doesn't sound reactive at all as it produces dummy loops and wastes CPU cycles."}}
{"actor":{"display_login":"alobakov"}}