title: Angular event emitter with combineLatest initial value
body: <p>Trying to make a DataSource for angular2 material table using ngrx store. <a href="https://material.angular.io/components/table/examples" rel="nofollow noreferrer">https://material.angular.io/components/table/examples</a> In the sort example they access the _exampleDatabase data directly when either the sort or data changes. Using ngrx the data cannot be accessed directly so I am trying to use rxjs operators to sort the data.  </p>
  
  <pre><code>export class ExampleDataSource extends DataSource&lt;any&gt; {
      constructor(private _sort: MdSort, private _storeData$: Observable&lt;UserData[]&gt;) {}
  
      connect(): Observable&lt;UserData[]&gt; {
          return Observable.combineLatest(this._storeData$, this._sort.mdSortChanage, 
              (data, sort) =&gt; {
                   // sorting logic here
                   return data;
              })
      }
  </code></pre>
  
  <p>This works fine once I change the sort order or dispatch a new event to change the user data in the store. I need to get the initial data from each to display. Is there an rxjs operator I am missing to make this happen? Or is there another better approach for this scenario.  </p>
  
  <p>I have tried using withLatestFrom and startWith but both were unsuccessful.  </p>
  
  <p>Thanks!  </p>
  
  <p>Edit: Added a plunkr that shows the issue <a href="http://plnkr.co/edit/5HOJSKKmdCuns2kvSirS?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/5HOJSKKmdCuns2kvSirS?p=preview</a> on main.ts. When removing the eventEmitter from the combineLatest call then the expected message prints. Since mdSort doesn't emit an event until clicked this is probably causing my issue. </p>
  
  <p>Edit2: See Sergey comment below for solution. Working plunkr is also in comments since my reputation isn't high enough to post 2 links. Since the event emitter did not output at least one value, I needed to add startWith on the event emitter and it worked. </p>