How to handle an empty result with rxjs observable
问题 I have an API that might return [] result. HTTP/1.1 200 OK Date: Tue, 16 Apr 2018 06:06:22 GMT Content-Type: application/json; charset=utf-8 Server: Kestrel Transfer-Encoding: chunked Request-Context: appId=cid-v1:... [] Here is my code that just does not work in that particular case: getData(): Observable<Thing[]> { return this.getData1() .pipe( flatMap(aData => { const ids = aData.map(({ id }) => id); const bData = this.getBData(ids); // emty result might be here //test subscribe this