Skip to content
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

Add IObservable<T> extensions for IMessenger #461

Merged
merged 2 commits into from
Oct 12, 2022

Conversation

Sergio0694
Copy link
Member

Closes #408

This PR adds observable extensions for IMessenger with the following public API:

namespace CommunityToolkit.Mvvm.Messaging;

partial class IMessengerExtensions
{
    public static IObservable<TMessage> CreateObservable<TMessage>(this IMessenger messenger)
        where TMessage : class;

    public static IObservable<TMessage> CreateObservable<TMessage, TToken>(this IMessenger messenger, TToken token)
        where TMessage : class
        where TToken : IEquatable<TToken>;
}

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

@Sergio0694 Sergio0694 added feature 💡 A new feature being implemented mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit labels Oct 3, 2022
@Sergio0694 Sergio0694 merged commit e2140f2 into main Oct 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the dev/messenger-observable branch October 12, 2022 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 💡 A new feature being implemented mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messenger extensions to bridge functionality to IObservable<T>
2 participants