Here is a function that triggers after selecting from a dropdown to choose the floor. As you can see, there are 3 levels of API calls (regular HTTP GET requests with JSON responses) that chain together. The first 2 are regular requests and the 3rd one polls. How can I write this in a better way that utilizes RXJS and observable functions?onChange(floor) {    this.selectedFloor = floor;    this.floorService.getRoomsInFloor(floor).subscribe((rooms:IRoom[])=>{        rooms.forEach((room:IRoom)=>{            this.floorService.getDeviceInRoom(room.roomId).subscribe((device:IDevice)=>{                    this.floorService.getLatestStatusOfDeviceInRoom(device.deviceId).subscribe((status:IStatus)=>{                    if(status)                    {                    status.occupied == true? this.rooms[room.roomId][4] = red : this.rooms[room.roomId][4] = green;                    }                    this.renderRooms();                });            });        });    }); }getRoomsInFloor(floorid){    return this.http.get(`example.com/floor/${floorid}/rooms`).map(res => res.json()).catch(this._serverError)}getDeviceInRoom(roomid){    return this.http.get(`example.com/devices/${roomid}`).map(res => res.json()).catch(this._serverError)}getLatestStatusOfDeviceInRoom(deviceid){    return Observable.timer(0,2000).switchMap(()=> this.http.get(`example.com/roomPresences/${deviceid}/latest`).map(res => res.json()).catch(this._serverError));}
Chaining 3 dependent HTTP request subscriptions one, which is polling
javascript;rxjs;angular 2+