ReactiveX / rxjs

A reactive programming library for JavaScript
https://rxjs.dev
Apache License 2.0
30.83k stars 3.01k forks source link

Improve type inference with `zen-observable` #7472

Open forivall opened 6 months ago

forivall commented 6 months ago

Description:

While trying to consume a zen-observable into rxjs via from, the types weren't being inferred. I added a facscimille of the zen-observable types as CompatObservable to the tests to figure out how it was failing, and discovered the solution of adding a InteropSubscribable with an overload, which allowed the types to infer properly. This might be a shortcoming of typescript itself, but, in the meantime, this seems to work well.

Related issue (if exists):