Prism
Prism copied to clipboard
[Enhancement] Support for async subscribers in the EventAggregator
Summary
Hi, as previously requested here: #832. Could this be reconsidered for implementation? Now that there is a AsyncDelegateCommand, it seems this would also be similarly useful. This increases test ability, without having to make subscribing methods public and creating async voids anonymous methods as a wrapper. It can still work as fire and forget when actually called.
API Changes
PubSubEvent.Subcribe(Func<Task> action); PubSubEvent.Unsubcribe(Func<Task> action);
Intended Use Case
For unit tests predominantly so that the subscribe method can be extracted through mocking the PubSubEvent, and subsequently called without making the method public.
Also reduces need for async voids and extra overhead of that.