I have the following requirement:

* I have an array of data
* For each item in the array I need to perform a call resulting in an Observable
* I need to chain all these observables together
* If one of the observables results in a false response I need to return false
	+ further observables should not have to proceed

The context is a guard in Angular which uses canActivate() returning an Observable<boolean>

I want to avoid following construction in the guard (pseudo code):

```
// the actions to check
var actions = ['x', 'y', 'z'];

canActivate() : Observable<boolean> {
    return this.performAction(actions[0]).subscribe(result => {
      if(result){
        this.performAction(actions[1]).subscribe(result2 => {
           if(result2){
               this.performAction(actions[2]).subscribe(result3 => {
                 ...
               };
           }
       });
   }
   //result = false;
 };
}

```