How do I return multiple values in Angular2 Typescript

Viewed 10691

I am trying to return multiple values in typescript when implementing both the filter and pagination function in md-table. when I run the code I get the error Unreachable code detected.

 return Observable.merge(...displayPatientDataChanges).map(() => {
   const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
   const data = this._patientDatabase.data.slice();
   return data.splice(startIndex, this._paginator.pageSize);

 // I get the error here on the second return function
   return this._patientDatabase.data.slice().filter((item: Patient) => {
     let searchStr = (item.firstname + item.lastname).toLowerCase();
     return searchStr.indexOf(this.filter.toLowerCase()) != -1;
   });

 });
}

disconnect() {}
1 Answers
Related