AsyncSubject.cs 703 B

12345678910111213141516171819
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Reactive.Subjects
  5. {
  6. public static class AsyncSubject
  7. {
  8. public static IAsyncSubject<T> Create<T>(IAsyncObserver<T> observer, IAsyncObservable<T> observable)
  9. {
  10. if (observer == null)
  11. throw new ArgumentNullException(nameof(observer));
  12. if (observable == null)
  13. throw new ArgumentNullException(nameof(observable));
  14. return new AnonymousAsyncSubject<T>(observer, observable);
  15. }
  16. }
  17. }