// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT License. // See the LICENSE file in the project root for more information. using System.Reactive.Disposables; namespace System.Reactive.Linq.ObservableImpl { internal sealed class Never : IObservable { /// /// The only instance for a TResult type: this source /// is completely stateless and has a constant behavior. /// internal static readonly IObservable Default = new Never(); /// /// No need for instantiating this more than once per TResult. /// private Never() { } public IDisposable Subscribe(IObserver observer) { if (observer == null) { throw new ArgumentNullException(nameof(observer)); } return Disposable.Empty; } } }