Ben Lesh
Ben Lesh
@noamr `.buffer(1)` can't be created/composed with a ref-counted observable, unfortunately. We'd need the constructor to allow an opt-in like: `new Observable(fn, { buffer: 1 })` or the like... even if...
> I don't understand why it "can't" The result of `observable.buffer(1)` would need to replay the last buffered value to every new subscriber. But an always ref-counted observable can't treat...
@domfarolino How could this be implemented on top of a ref-counted observable? Here it is with a _cold_ observable: ```ts ColdObservable.prototype.buffer = function (bufferSize) { let buffer = []; const...
LOL... I'm so sorry, I'm not following what the idea is. Generally speaking, a ref-counted observable is implemented pretty much the same way a cold-observable is... with the difference being...
Okay, so I put together a ref-counted Observable example in a [StackBlitz](https://stackblitz.com/edit/vitejs-vite-yo8fjn?file=src%2Fmain.ts,index.html&terminal=dev) It should show the behavior. It will hopefully also demonstrate how there's not really a way to send...
Really the only issue I have at all with the proposal as it stands, the ONLY issue, is that there's no way to create an observable that "replays" previous values...
A `.buffer(5)` type method won't work because methods create new observables and return them, you need to be able to do something that identifies new subscribers as they join so...
After some discussion and thought about when ref-counted observables should unsubscribe, in particular when references counted hits zero, it should happen synchronously for now and probably be configurable later. I...
> I'm honestly personally not convinced that buffering is _so_ important that it must be included in native Observables immediately The whole buffering (or even better, the JS platform style...
Short-short version: Implementing all operators on Observable in terms of `this.constructor` or the like would enable folks like myself to build pretty much anything we need to build off of...