title: Angular 5 new immutable HttpClient breaks dynamic URL params
body: <p>I have not worked too much with immutables in Typescript but the new Angular update has me stuck. I tried updating my own Http service with the new Http lib. Now I cannot dynamically add url parameters to Http GET requests.</p>
  
  <p>The issue is explained here:
  <a href="https://medium.com/spektrakel-blog/angular-httpclient-enforces-immutability-dad161d8714b" rel="nofollow noreferrer">https://medium.com/spektrakel-blog/angular-httpclient-enforces-immutability-dad161d8714b</a></p>
  
  <p>I have a simple function that is supposed to handle different ways of dynamically adding, either by passing a generic object or an object with both a 'key' and a 'value' property. It looks like this:</p>
  
  <pre><code>public setParams(reqOptions) {
    let params;
    if (reqOptions) {
      if (reqOptions.key &amp;&amp; reqOptions.value) {
        params = new URLSearchParams;
        params.append(reqOptions.key, reqOptions.value);
      } else {
        params = new URLSearchParams;
        for (let item in reqOptions) {
          if (reqOptions.hasOwnProperty(item)) {
            params.append(item, reqOptions[item]);
          }
        }
      }
    }
    return params;
  }
  </code></pre>
  
  <p>Is there any way to recreate this functionality with immutables?</p>
  
  <p>So if I had an object such as</p>
  
  <pre><code>{
    status: 'new',
    per_page: 50,
    page: 0
  }
  </code></pre>
  
  <p>And I called the above function like this</p>
  
  <pre><code>listShipments(reqOptions?): Observable&lt;any&gt; {
    let params = this.setParams(reqOptions);
    return this.http.get(this.baseUrl + '/shipments', {params: params})
      .map(this.extractData);
  }
  </code></pre>
  
  <p>it would rewrite the request url to</p>
  
  <p><code>shipments?status=new&amp;per_page=50&amp;page=0</code></p>
  
  <p>I found this overly useful as I could easily pass a dynamic set of parameters along with the call. How could I recreate this with immutables?</p>
  
  <p>(btw: so much for "non-breaking", switching to immutables seems rather non-trivial to update in this case) </p>