bordoley / reactive-js

Fast modern reactive Javascript programming library
MIT License
11 stars 0 forks source link

Prevent passing hot observable to operators like Concat #529

Closed bordoley closed 1 year ago

bordoley commented 1 year ago

Need to do it via the type system, but strictly speaking they're not concatable because they are not cold.

Probably need to add a cold or is multicasted flag. They can be used endWith, but not startWith and the could be the first argument to concat but not the second.

bordoley commented 1 year ago

Applies to StreamLike, MulticastObservable, PauseableObsevable, PublisherLike, and any Observable produced by share().

bordoley commented 1 year ago

One good option is to limit concat to RunnableObservables.

bordoley commented 1 year ago

Though that kind of sucks because an observable had iterates through an async iterable or a promise IE. a deferred observable is safe.

bordoley commented 1 year ago

Fixed in the rewrite branch that will be merged soon