title: angular 5 run different thread in a background
body: <p>I am using angular 5 with pouchdb. When I save a user I need to show it immediately in the users list. Meanwhile a background thread must geolocate the users city and update its coordinates for that user. </p>
  
  <p>The geolocation calculation takes a second or two to load that is why I am thinking of running in a background thread. </p>
  
  <p>I looked into <a href="https://angular.io/guide/service-worker-intro" rel="nofollow noreferrer">angular service worker</a>, But I think its for getting files for offline.</p>
  
  <p>I also looked <a href="https://github.com/kaikcreator/angular-cli-web-worker" rel="nofollow noreferrer">angular cli web worker</a>, But It did not mention how to call a background service and get a value back to main thread.</p>
  
  <p>Is there a clear way to run a background thread in angular 5?</p>