title: Store Observable and subscribe to it later - Angular 7
body: <p>I expect an Angular 7 client to be regularly offline for hours. </p>
  
  <p>Connected: process HTTP requests normally using observables. 
  No connection: store the observable somewhere so I can subscribe to it later, when the connection is reestablished. </p>
  
  <p>This code is condensed for brevity:</p>
  
  <pre><code>let someObservable = this.service.returnAnObservable();
  
  if (isOnline) {
    // fire off the HTTP request and handle it
    someObservable.subscribe(... stuff ...);
  } else {
    *** store the observable somewhere ***
  }
  
  // track when network is back online
  this.network.connectionChanged.subscribe(backOnline =&gt; {
    if (backOnline) this.synchronize();
  });
  
  private synchronize(): void {
    let observables = ** get the observables out of storage **
    observables.forEach(ob =&gt; {
      // let attempt = new Observable(JSON.parse(ob));
      // let another = ob as Observable&lt;any&gt;;
      // let isThisPossible = &lt;Observable&lt;any&gt;&gt;JSON.parse(ob);
  
      // however the Observable is reconstructed, subscribe to it
      observable.subscribe()
    });
  }
  </code></pre>
  
  <p>Any ideas on this or is it even possible? The observable itself is a nice tidy object, I'd really like to be able to store and rebuild it at will.</p>