Ejemplo n.º 1
0
        protected override async Task <IAsyncDisposable> SubscribeAsyncCore(IAsyncObserver <TSource> observer)
        {
            if (_disposable != null)
            {
                var d = await _disposable.GetDisposableAsync().ConfigureAwait(false);

                var s = await _subject.SubscribeAsync(observer).ConfigureAwait(false);

                return(StableCompositeAsyncDisposable.Create(d, s));
            }

            return(await _subject.SubscribeAsync(observer).ConfigureAwait(false));
        }
        public ValueTask <IAsyncDisposable> SubscribeAsync(IAsyncObserver <TResult> observer)
        {
            if (observer == null)
            {
                throw new ArgumentNullException(nameof(observer));
            }

            return(subject.SubscribeAsync(observer));
        }