Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a655578cf6
Fetching contributors…

Cannot retrieve contributors at this time

file 22 lines (18 sloc) 0.584 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
using System;

namespace Reactive
{
    public class SelectObservable<T1, T2> : IObservable<T2>
    {
        private readonly IObservable<T1> _inner;
        private readonly Func<T1, T2> _selector;

        public SelectObservable(IObservable<T1> inner, Func<T1, T2> selector)
        {
            _inner = inner;
            _selector = selector;
        }

        public IDisposable Subscribe(IObserver<T2> observer)
        {
            return _inner.Subscribe(ObserverBuilder.Create(observer, (T1 a) => observer.OnNext(_selector(a))));
        }
    }

}
Something went wrong with that request. Please try again.