Conversation
Observable.create's one-argument version was not properly documented, and the return type is not described either. But to document that it returns a Subscription we should first make it do so.
RxLua only has a zero-version create() function for Subject, corresponding to the constructor of RxJS for example. However, RxJS has a two-argument create() function, returning a subject that simply juxtaposes an observable and an observer into a single object. Quite confusingly, the object returned by create() is not a Subject, but an instance of a different class AnonymousSubject. Introduce AnonymousSubject as a completely separate implementation to avoid overloading Subject.create.
|
Hi, could you please take a look at this? |
|
Personally I'm wondering what's the use case for that? I know the AnonymousSubject class but I've never seen it actually used anywhere in the real code outside of the RxJS internals. Can you provide some examples when is it useful to have something like that? |
|
You can use On the Observer side, the |
|
Thanks for the explanation. I'm maintaining a fork of this library which I called Lua-ReactiveX and I've also included I'm considering however to rename it to something else like ProxySubject and leave it private behind the scenes, and then an actual public implementation of |
|
Not sure when but yeah, I can contribute with a pull request. |
RxLua only has a zero-version create() function for Subject, corresponding to the constructor of RxJS for example. However, RxJS and other ReactiveX implementations also have a two-argument create() function, returning a subject that simply juxtaposes an observable and an observer into a single object. Quite confusingly, the object returned by create() is not a Subject, but an instance of a different class
AnonymousSubject. This pull request introducesAnonymousSubjectas a completely separate implementation to avoid overloading Subject.create.