title: Dynamically concatenate observables
body: <p>I use .NET's observables / LINQ and I want to do a pretty simple thing. In my app, I get lists of Media objects:</p>
  
  <pre><code>WebinarMedias = typesRepository.GetWebinarMedias();
  </code></pre>
  
  <p>This will be an <code>IObservable&lt;IList&lt;Media&gt;&gt;</code>. We're in a view model, I pass that down to a view, which will do the subscription (these are cold observables when created in the view model).
  There, it's fine, the view wants Medias.</p>
  
  <p>But sometimes I have <em>Packages</em>:</p>
  
  <pre><code>typesRepository.GetMonthlyFocusPackages() // IObservable&lt;IList&lt;Package&gt;&gt;
  </code></pre>
  
  <p>From a Package, I can get Medias:</p>
  
  <pre><code>packagesRepository.GetPackageMedias(package.Id) // IObservable&lt;IList&lt;Media&gt;&gt;
  </code></pre>
  
  <hr>
  
  <p><em>What I want:</em> in the view model, get packages, reduce to a list of all the medias they include in one <code>IObservable&lt;IList&lt;Media&gt;&gt;</code> variable, and display in the view.</p>
  
  <p>More visually:</p>
  
  <pre><code>input = [package 1 { media 1, media 2 }, package 2 { media 3 }]
  output = [media 1, media 2, media 3]
  </code></pre>
  
  <p>Something like that:</p>
  
  <pre><code>var allMedias = typesRepository.GetMonthlyFocusPackages()
      .SomeMagicSelect(packages =&gt; packages.Select(p =&gt; packagesRepository.GetPackageMedias(p.Id)));
  </code></pre>
  
  <p>I could do foreaches and use more classic code for sure but I'd like to keep the observable cold and keep the value reactive from end to end.</p>