title: Angular 7 - Save HTTP Requests to Local storage
body: <p>I'm working with angular 7, sending requests to my backend using angular httpclient
  and i'm intercepting requests in case of failure and save it to the local storage in order to retry when the connection is stable</p>
  
  <blockquote>
    <p>import { LocalStorage } from '@ngx-pwa/local-storage';</p>
  </blockquote>
  
  <pre><code>this.localStorage.getItem&lt;HttpRequest&lt;any&gt;[]&gt;('failed').subscribe((failed:HttpRequest&lt;any&gt;[]) =&gt; {
                      console.log(typeof request);
                      if(failed==null)
                      {
                          var newFailed =new Array&lt;HttpRequest&lt;any&gt;&gt;();
                          newFailed.push(request);
                          this.localStorage.setItem('failed', newFailed).subscribe(() =&gt; {});
                      }
                      else
                      {
                          failed.push(request);
                          this.localStorage.setItem('failed', failed).subscribe(() =&gt; {});
                      }
                      console.log(failed);
                  });
  </code></pre>
  
  <p>my issue is that when fetching the array again in another code, the objects in my array isn't of type HttpRequest so i can't loop on them and pass to httpclient to retry that request again.</p>
  
  <p>any solutions ?</p>