Let\'s say, we have a class:
public class Foo
{
public string Do(int param)
{
}
}
I\'d like to create an observable of values that are
Matt's answer made me thinking about this:
public class Foo
{
private readonly Subject _doValues = new Subject();
public IObservable DoValues { get { return _doValues; } }
public string Do(int param)
{
var ret = (param * 2).ToString();
_doValues.OnNext(ret);
return ret;
}
}
var foo = new Foo();
foo.DoValues.Subscribe(Console.WriteLine);
foo.Do(2);