reactiveui/website

Issue with docs/handbook/message-bus/index.md

kurtyoder opened this issue · 3 comments

When using the example for the scenario, a ViewModel of open documents containing a list of Document ViewModels - each Document containing a Close command, I ran into an issue. When each of the documents was a tab page, it worked fine if I closed the current tab. If I closed a background tab, nothing would happen and I would be unable to close even the current tab.

When I switched out Switch() with Merge() it worked as expected.

// to close, remove it from the list.
OpenDocuments
.ToObservableChangeSet()
.AutoRefreshOnObservable(document => document.Close)
.Select(_ => WhenAnyDocumentClosed())
.Switch() //Replaced this with Merge()
.Subscribe(x => OpenDocuments.Remove(x));

I am very new to reactiveui so I'm not sure why is this behavior happening. Is the example faulty or is there another explanation?

Could this possibly be related to #742 (comment)?

Can you please create reproduction repository? Because I did not succeed to simulate your issue.

Unable to replicate

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.