from(Subscribable)
- Part Two
#6964
kajetansw
started this conversation in
Ideas / Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all! 👋 I hope you're doing well.
I'd like to touch on a year-old RFC about
from(Subscribable)
support.I know, at the time it seemed like there wasn't enough use-cases for it to make it happen, but please bear with me while add my two cents...
Reason
The reason I'm mentioning this, is that I really wished to use Observables in SolidJS where you have an
observable
method designed to convert Solid's signals to Observables.Example of that:
But there are some TS type errors when trying to do so, you can see it in action here: https://stackblitz.com/edit/solid-vite-ogtpkn?file=src/index.tsx
It seems like those two types (RxJS's
ObservableInput
and Observable's definition in SolidJS) are incompatible.Observable's definition in SolidJS is the one that is in shape of "objects that have a subscribe() method", just like described in the previous RFC.
Solution?
I saw in the previous issue, that
Subscribable
was already considered to be added to a possible type forObservableInput
, like:As it has the desirable shape already:
And then the Observable be created with sth like:
I find it very similar case to how the
InteropObservable
is already handled. Do you think so too?Conclusion
I don't know if it's enough of a case or a simple addition to make, I just want to hear your opinion on that.
I'm sorry to bring this back from the dead and thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions