electric icon indicating copy to clipboard operation
electric copied to clipboard

Move `stream.subscribe()` to be part of the constructor

Open KyleAMathews opened this issue 3 months ago • 22 comments

e.g. new ShapeStream({ subscribe: () => {} })

The problem with .subscribe() is then people get the sense that they can subscribe whenever and they'll get the full stream where if you delay calling .subscribe then you'll miss the early messages. So to avoid this footgun and in general, keep construction of streams fixed & declarative, let's move subscriptions to the constructor.

KyleAMathews avatar Nov 19 '24 15:11 KyleAMathews