electric
electric copied to clipboard
Move `stream.subscribe()` to be part of the constructor
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.