<PackageReference Include="System.Reactive" Version="6.0.1" />

Defer<TValue>

sealed class Defer<TValue> : Producer<TValue, _<TValue>>, IEvaluatableObservable<TValue>
using System.Runtime.CompilerServices; namespace System.Reactive.Linq.ObservableImpl { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 1, 1 })] internal sealed class Defer<[System.Runtime.CompilerServices.Nullable(2)] TValue> : Producer<TValue, Defer<TValue>._>, IEvaluatableObservable<TValue> { [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] internal sealed class _ : IdentitySink<TValue> { private readonly Func<IObservable<TValue>> _observableFactory; public _(Func<IObservable<TValue>> observableFactory, IObserver<TValue> observer) : base(observer) { _observableFactory = observableFactory; } public void Run() { IObservable<TValue> source; try { source = _observableFactory(); } catch (Exception error) { ForwardOnError(error); return; } Run(source); } } private readonly Func<IObservable<TValue>> _observableFactory; public Defer(Func<IObservable<TValue>> observableFactory) { _observableFactory = observableFactory; } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] protected override _ CreateSink(IObserver<TValue> observer) { return new _(_observableFactory, observer); } protected override void Run([System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] _ sink) { sink.Run(); } public IObservable<TValue> Eval() { return _observableFactory(); } } }