locked
How do I cast a generic IObservable<x> to an IObservable<Unit>? RRS feed

  • Question

  • The use case is merging detection of changes on a series of observable properties where I don't care what the change is, but need to track that a change has taken place to set a dirty flag. Merge needs the IObservable signatures to match. (n.b. I'm using ReactiveUI here, hence the observable properties, which are on a view model).

     

    Thanks

    Dan


    Wednesday, August 3, 2011 5:57 PM

Answers

  • Hi Dan,

    xs.Select(_ => Unit.Default);
    

    - Dave


    http://davesexton.com/blog

    Wednesday, August 3, 2011 8:38 PM

All replies

  • Hi Dan,

    xs.Select(_ => Unit.Default);
    

    - Dave


    http://davesexton.com/blog

    Wednesday, August 3, 2011 8:38 PM
  • Thanks Dave,

     

    Dawned on me as I left the office I needed to do a select!

     

    Dan

    Thursday, August 4, 2011 8:52 AM