Q:

How to: request the url and zip it with response in rxjs? 

I am doing it like this:
let urls = [url1, url2, url3];

let urls_ = Observable
      .from(urls);

let ajax = function() { return promise; };

let results_ = urls_
      .flatMap(ajax)
      .zip(
        urls_,
        (response, url) => {
          return {url, response};
        }
      )

But the problem with this is that {response, url} pairs mismatch, that url1 don't really go with response1.  I am facing this use-case too often to not have an operator for this, i.e do something async on an initial Observable, then pass both the initial observable and async result forward. 
Is there an operator in RxJS for doing this?  Otherwise how can I accomplish 1-1 zipping in my example? 

A:

flatMap has an overload that will handle it for you, the second argument accepts a method which has the signature
function resultSelector(outerValue, innerValue, outerIndex, innerIndex)

You use it like so
let urls = [url1, url2, url3];

let urls_ = Observable
      .from(urls);

let ajax = function() { return promise; };

let results_ = urls_
      .flatMap(ajax, 
         (url, response) => {
           return {url, response}; 
         })
      )

