Expand Operator in Stable Build

Dec 4, 2012 at 11:55 PM

Hi Rx Team,

Why is the Expand operator in the experimental build?  Is there a simpler alternative?

I discovered a potential need for it in Rxx, but I wanted to avoid taking a dependency on the experimental build.

(Sorry if this was explained already, but I couldn't find an answer on the blog or the forum.)


Dec 6, 2012 at 6:22 AM


FYI, I've determined that using Func<TSource, IObservable<TResult>> as a parameter in my operator is better.  Expand, when applied to a parameter for an operator, appears to be useful only when unfolding a single data type.  This makes it more difficult for callers that have heterogeneous types.  Furthermore, callers may end up using a switch statement to perform the recursion instead of simpler alternatives, such as passing in an observable composed of Merge or Concat queries.  Since for my particular usage the recursion would have to end at some point, probably quite shallowly in most cases, providing support for a SelectMany-like parameter is better.

I'm still curious though why it's just an experimental operator.  Is the reason similar to my explanation?  I seem to remember discussing this before but I can't find it on the forum.

- Dave

Dec 21, 2012 at 9:07 PM

Hi Dave,

No deep reason except that it is a rather obscure operator, you are probably the first person outside of the team that has ever used it ;-)

And in case you have other overloads you want to add, please make a pull request, and we are happy to take it.


Dec 21, 2012 at 11:47 PM

Ha, good enough :)