-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ReactiveCommand Observable does not propagate results #3942
Comments
@Micha-kun please could you provide a Repo with the code so that we can assist you, I have tried the code you have shown and this works as expected. |
I was trying too in a clean app and cannot replicate too, so I was wondering if the problem comes with RxApp initialization... Because in my app i'm using Splat.Microsoft.Extensions.DependencyInjection to initialize Splat with Generic Host but there is a problem because i'm using https://github.com/alex-oswald/WindowsFormsLifetime for a better integration of Winforms hosting into Generic Host and it generates a problem: During service initialization, it's called under one thread but WindowsFormsLifetime, after that, creates a new thread for Winforms form in a new STA thread. Doing that, because Splat initialization is done in another thread, RxApp.MainThread is using a wrong "UI thread", not the one WindowsFormsLifetime creates. What I did to fix that is replace it when it calls the main form with a ControlScheduler, and it's fine but, is there a way to regenerate it using ReactiveUI api? Thanks
|
Perhaps try using reactivemarbles.extensions.hosting.reactiveui.winforms |
I didn't know those extensions, thanks! I need to investigate them 👍 |
How did you get on with the Reactivemarbles.Extensions.Hosting packages? |
Describe the bug 🐞
I don't know if it's a bug or something I'm doing wrong...
I have a ReactiveCommand that returns an IEnumerable and I'm trying to chain those results to another pipeline, like in this code example:
The
GetDataCommand
RC is aTask
method withUnit
as Input andIEnumerable
as Output.this.GetDataCommand.Execute()
really executes succesfully, but, unexpectedly, theDo
method attached before to the command never executes after. I tried to wrap command insidethis.WhenAnyObservable()
without exit. What I'm doing wrong? At first I thought it was because I was usingReactiveUI.SourceGenerators
, but I tried with plain ReactiveCommands with the same results. I tried removing thoseDisposeWith(d)
too and nothing changed.My app is a Winforms app in .Net 8. ViewModel is in a Class Library only for ViewModels.
Step to reproduce
1 - Test my sample.
Reproduction repository
https://github.com/reactiveui/ReactiveUI
Expected behavior
Do/Select/Subscribe code executing
Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows
Version
11
Device
PC
ReactiveUI Version
20.1.63
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: